Skip to content

Commit 0e65aeb

Browse files
committed
tidy: features.rs: collect_lib_features: Simplify
Use `if let` to simplify a match, and use `contains_key` instead of `get`.
1 parent 87658bb commit 0e65aeb

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/tools/tidy/src/features.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -259,14 +259,11 @@ pub fn collect_lib_features(base_src_path: &Path) -> Features {
259259

260260
map_lib_features(base_src_path,
261261
&mut |res, _, _| {
262-
match res {
263-
Ok((name, feature)) => {
264-
if lib_features.get(name).is_some() {
265-
return;
266-
}
267-
lib_features.insert(name.to_owned(), feature);
268-
},
269-
Err(_) => (),
262+
if let Ok((name, feature)) = res {
263+
if lib_features.contains_key(name) {
264+
return;
265+
}
266+
lib_features.insert(name.to_owned(), feature);
270267
}
271268
});
272269
lib_features

0 commit comments

Comments
 (0)