on master help sign in
Clippy lint: replace with default -> take
31e6bcbBlaž Hrastnik
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> {
62 match tag {
62 match tag {
63 Tag::Heading(_) | Tag::Paragraph | Tag::CodeBlock(CodeBlockKind::Fenced(_)) => {
63 Tag::Heading(_) | Tag::Paragraph | Tag::CodeBlock(CodeBlockKind::Fenced(_)) => {
64 // whenever code block or paragraph closes, new line
64 // 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);
66 if !spans.is_empty() {
66 if !spans.is_empty() {
67 lines.push(Spans::from(spans));
67 lines.push(Spans::from(spans));
68 }
68 }
@@ -118,7 +118,7 @@ fn parse<'a>(contents: &'a str, theme: Option<&Theme>) -> tui::text::Text<'a> {
118 slice = &slice[end + 1..];
118 slice = &slice[end + 1..];
119
119
120 // make a new line
120 // make a new line
121− let spans = std::mem::replace(&mut spans, Vec::new());
121+ let spans = std::mem::take(&mut spans);
122 lines.push(Spans::from(spans));
122 lines.push(Spans::from(spans));
123 }
123 }
124
124