Skip to content

Commit 7c6362a

Browse files
committed
expand-yaml-anchors: fix clippy::match_ref_pats and clippy::redundant_closure
1 parent 0ec9459 commit 7c6362a

File tree

1 file changed

+3
-5
lines changed
  • src/tools/expand-yaml-anchors/src

1 file changed

+3
-5
lines changed

src/tools/expand-yaml-anchors/src/main.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ impl App {
4848
// Parse CLI arguments
4949
let args = std::env::args().skip(1).collect::<Vec<_>>();
5050
let (mode, base) = match args.iter().map(|s| s.as_str()).collect::<Vec<_>>().as_slice() {
51-
&["generate", ref base] => (Mode::Generate, PathBuf::from(base)),
52-
&["check", ref base] => (Mode::Check, PathBuf::from(base)),
51+
["generate", ref base] => (Mode::Generate, PathBuf::from(base)),
52+
["check", ref base] => (Mode::Check, PathBuf::from(base)),
5353
_ => {
5454
eprintln!("usage: expand-yaml-anchors <source-dir> <dest-dir>");
5555
std::process::exit(1);
@@ -138,9 +138,7 @@ fn filter_document(document: Yaml) -> Yaml {
138138
.map(|(key, value)| (filter_document(key), filter_document(value)))
139139
.collect(),
140140
),
141-
Yaml::Array(vec) => {
142-
Yaml::Array(vec.into_iter().map(|item| filter_document(item)).collect())
143-
}
141+
Yaml::Array(vec) => Yaml::Array(vec.into_iter().map(filter_document).collect()),
144142
other => other,
145143
}
146144
}

0 commit comments

Comments
 (0)