We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 98eb7da commit 5e30a01Copy full SHA for 5e30a01
src/bin/cargo-fmt.rs
@@ -261,12 +261,12 @@ fn filter_packages_with_hitlist<'a>(
261
packages: Vec<Value>,
262
workspace_hitlist: &'a WorkspaceHitlist,
263
) -> Result<Vec<Value>, &'a String> {
264
- if *workspace_hitlist == WorkspaceHitlist::All {
+ let some_hitlist: Option<HashSet<&String>> =
265
+ workspace_hitlist.get_some().map(HashSet::from_iter);
266
+ if some_hitlist.is_none() {
267
return Ok(packages);
268
}
- let mut hitlist: HashSet<&String> = workspace_hitlist
- .get_some()
269
- .map_or(HashSet::new(), HashSet::from_iter);
+ let mut hitlist = some_hitlist.unwrap();
270
let members: Vec<Value> = packages
271
.into_iter()
272
.filter(|member| {
0 commit comments