Skip to content

Commit

Permalink
Fix clippy::manual_retain
Browse files Browse the repository at this point in the history
  • Loading branch information
sgued authored and Keats committed Feb 16, 2023
1 parent faf00d1 commit 0183ea5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion components/content/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub fn find_related_assets(path: &Path, config: &Config, recursive: bool) -> Vec
}

if let Some(ref globset) = config.ignored_content_globset {
assets = assets.into_iter().filter(|p| !globset.is_match(p)).collect();
assets.retain(|p| !globset.is_match(p));
}

assets
Expand Down
11 changes: 4 additions & 7 deletions components/markdown/src/markdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -482,13 +482,10 @@ pub fn markdown_to_html(
}

// We remove all the empty things we might have pushed before so we don't get some random \n
events = events
.into_iter()
.filter(|e| match e {
Event::Text(text) | Event::Html(text) => !text.is_empty(),
_ => true,
})
.collect();
events.retain(|e| match e {
Event::Text(text) | Event::Html(text) => !text.is_empty(),
_ => true,
});

let heading_refs = get_heading_refs(&events);

Expand Down

0 comments on commit 0183ea5

Please sign in to comment.