]> git.lizzy.rs Git - rust.git/commitdiff
Do not propagate io error when dependencies are not found
authortopecongiro <seuchida@gmail.com>
Sat, 28 Oct 2017 07:40:18 +0000 (16:40 +0900)
committertopecongiro <seuchida@gmail.com>
Sat, 28 Oct 2017 07:40:18 +0000 (16:40 +0900)
src/bin/cargo-fmt.rs

index 10d08ff7d19d6fba89a7fa6dab13620c910aabce..dac20fe28777cbf28cd99d758ee918451fdfa6b7 100644 (file)
@@ -330,8 +330,13 @@ fn get_targets(workspace_hitlist: &WorkspaceHitlist) -> Result<Vec<Target>, io::
 
         // If we can find any local dependencies, we will try to get targets from those as well.
         for path in get_path_to_local_dependencies(&packages) {
-            env::set_current_dir(path)?;
-            targets.append(&mut get_targets(workspace_hitlist)?);
+            match env::set_current_dir(path) {
+                Ok(..) => match get_targets(workspace_hitlist) {
+                    Ok(ref mut t) => targets.append(t),
+                    Err(..) => continue,
+                },
+                Err(..) => continue,
+            }
         }
 
         env::set_current_dir(cur_dir)?;