Fix clippy::manual_retain

This commit is contained in:
Sosthène Guédon 2022-10-30 15:00:01 +01:00 committed by Vincent Prouillet
parent faf00d1047
commit 0183ea548a
2 changed files with 5 additions and 8 deletions

View File

@ -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 { 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 assets

View File

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