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,
|
||||
&mut |res, _, _| {
|
||||
match res {
|
||||
Ok((name, feature)) => {
|
||||
if lib_features.get(name).is_some() {
|
||||
if let Ok((name, feature)) = res {
|
||||
if lib_features.contains_key(name) {
|
||||
return;
|
||||
}
|
||||
lib_features.insert(name.to_owned(), feature);
|
||||
},
|
||||
Err(_) => (),
|
||||
}
|
||||
});
|
||||
lib_features
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue