on master help sign in
Clippy lint: replace with default -> take
commit31e6bcbeb4dcf52eef81a21caede8c8b32fa5858 authorBlaž Hrastnik <blaz@mxxn.io> dateWed 7 Apr 2021, 16:58 (6 years ago) parente8298a3
1 file changed+2−2
helix-term/src/ui/markdown.rs+2−2
helix-term/src/ui/markdown.rs+2−2
@@ -62,7 +62,7 @@ fn parse<'a>(contents: &'a str, theme: Option<&Theme>) -> tui::text::Text<'a> {
6262 match tag {
6363 Tag::Heading(_) | Tag::Paragraph | Tag::CodeBlock(CodeBlockKind::Fenced(_)) => {
6464 // whenever code block or paragraph closes, new line
65− let spans = std::mem::replace(&mut spans, Vec::new());
65+ let spans = std::mem::take(&mut spans);
6666 if !spans.is_empty() {
6767 lines.push(Spans::from(spans));
6868 }
@@ -118,7 +118,7 @@ fn parse<'a>(contents: &'a str, theme: Option<&Theme>) -> tui::text::Text<'a> {
118118 slice = &slice[end + 1..];
119119
120120 // make a new line
121− let spans = std::mem::replace(&mut spans, Vec::new());
121+ let spans = std::mem::take(&mut spans);
122122 lines.push(Spans::from(spans));
123123 }
124124