tidy: features.rs: collect_lib_features: Simplify
Use `if let` to simplify a match, and use `contains_key` instead of `get`.
This commit is contained in:
parent
87658bb667
commit
0e65aeb95d
1 changed files with 5 additions and 8 deletions
|
@ -259,14 +259,11 @@ pub fn collect_lib_features(base_src_path: &Path) -> Features {
|
||||||
|
|
||||||
map_lib_features(base_src_path,
|
map_lib_features(base_src_path,
|
||||||
&mut |res, _, _| {
|
&mut |res, _, _| {
|
||||||
match res {
|
if let Ok((name, feature)) = res {
|
||||||
Ok((name, feature)) => {
|
if lib_features.contains_key(name) {
|
||||||
if lib_features.get(name).is_some() {
|
return;
|
||||||
return;
|
}
|
||||||
}
|
lib_features.insert(name.to_owned(), feature);
|
||||||
lib_features.insert(name.to_owned(), feature);
|
|
||||||
},
|
|
||||||
Err(_) => (),
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
lib_features
|
lib_features
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue