diff options
author | Blaž Hrastnik | 2021-04-07 07:58:23 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-04-07 07:58:23 +0000 |
commit | 31e6bcbeb4dcf52eef81a21caede8c8b32fa5858 (patch) | |
tree | 83e9710dbbea5e587ef4ad3f3db3313c9c623c29 /helix-term/src/ui | |
parent | e8298a398c6b018c49025ff3f885e4f5f40b01fd (diff) |
Clippy lint: replace with default -> take
Diffstat (limited to 'helix-term/src/ui')
-rw-r--r-- | helix-term/src/ui/markdown.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/helix-term/src/ui/markdown.rs b/helix-term/src/ui/markdown.rs index 55b90ad4..0b41e044 100644 --- a/helix-term/src/ui/markdown.rs +++ b/helix-term/src/ui/markdown.rs @@ -62,7 +62,7 @@ fn parse<'a>(contents: &'a str, theme: Option<&Theme>) -> tui::text::Text<'a> { match tag { Tag::Heading(_) | Tag::Paragraph | Tag::CodeBlock(CodeBlockKind::Fenced(_)) => { // whenever code block or paragraph closes, new line - let spans = std::mem::replace(&mut spans, Vec::new()); + let spans = std::mem::take(&mut spans); if !spans.is_empty() { lines.push(Spans::from(spans)); } @@ -118,7 +118,7 @@ fn parse<'a>(contents: &'a str, theme: Option<&Theme>) -> tui::text::Text<'a> { slice = &slice[end + 1..]; // make a new line - let spans = std::mem::replace(&mut spans, Vec::new()); + let spans = std::mem::take(&mut spans); lines.push(Spans::from(spans)); } |