From b0c7201c0e3ea6a7d928a4c5e15b4a83417e6a06 Mon Sep 17 00:00:00 2001 From: topecongiro Date: Sat, 28 Oct 2017 16:40:18 +0900 Subject: [PATCH] Do not propagate io error when dependencies are not found --- src/bin/cargo-fmt.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/bin/cargo-fmt.rs b/src/bin/cargo-fmt.rs index 10d08ff7d19..dac20fe2877 100644 --- a/src/bin/cargo-fmt.rs +++ b/src/bin/cargo-fmt.rs @@ -330,8 +330,13 @@ fn get_targets(workspace_hitlist: &WorkspaceHitlist) -> Result, 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)?; -- 2.44.0