Skip to content

Commit fc926dc

Browse files
authored
Merge pull request #2093 from topecongiro/ignore-nontrivial-dependencies
Do not propagate io error when dependencies are not found
2 parents b22643a + b0c7201 commit fc926dc

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/bin/cargo-fmt.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,13 @@ fn get_targets(workspace_hitlist: &WorkspaceHitlist) -> Result<Vec<Target>, io::
330330

331331
// If we can find any local dependencies, we will try to get targets from those as well.
332332
for path in get_path_to_local_dependencies(&packages) {
333-
env::set_current_dir(path)?;
334-
targets.append(&mut get_targets(workspace_hitlist)?);
333+
match env::set_current_dir(path) {
334+
Ok(..) => match get_targets(workspace_hitlist) {
335+
Ok(ref mut t) => targets.append(t),
336+
Err(..) => continue,
337+
},
338+
Err(..) => continue,
339+
}
335340
}
336341

337342
env::set_current_dir(cur_dir)?;

0 commit comments

Comments
 (0)