We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0084b64 commit 1fda290Copy full SHA for 1fda290
crates/markdown_preview/src/markdown_parser.rs
@@ -858,11 +858,10 @@ impl<'a> MarkdownParser<'a> {
858
text: SharedString,
859
highlights: Vec<MarkdownHighlight>,
860
) -> Vec<(Range<usize>, MarkdownHighlight)> {
861
- let mut new_highlights = Vec::with_capacity(highlights.len());
862
- for style in highlights.iter() {
863
- new_highlights.push((0..text.len(), style.clone()));
864
- }
865
- new_highlights
+ highlights
+ .into_iter()
+ .map(|style| (0..text.len(), style))
+ .collect()
866
}
867
868
match &node.data {
0 commit comments