]> git.lizzy.rs Git - rust.git/commitdiff
Use package name instead of target name for --package filter
authorSeiichi Uchida <seuchida@gmail.com>
Wed, 6 Dec 2017 03:41:04 +0000 (12:41 +0900)
committerSeiichi Uchida <seuchida@gmail.com>
Wed, 6 Dec 2017 03:41:04 +0000 (12:41 +0900)
src/bin/cargo-fmt.rs

index e04d772ba0e603c83237b546ddc821ca3155940b..63d7d2c335343d4562c345b89a5570aa4d622d9a 100644 (file)
@@ -290,8 +290,8 @@ fn get_targets_with_hitlist(
     let mut workspace_hitlist: HashSet<&String> = HashSet::from_iter(hitlist);
 
     for package in metadata.packages {
-        for target in package.targets {
-            if workspace_hitlist.remove(&target.name) {
+        if workspace_hitlist.remove(&package.name) {
+            for target in package.targets {
                 targets.insert(Target::from_target(&target));
             }
         }