Skip to content

Commit

Permalink
Canonicalise the paths
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Tsuk committed Mar 9, 2018
1 parent 53dcb0d commit ba10a4c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cargo-fmt/main.rs
Expand Up @@ -249,9 +249,9 @@ fn get_targets(strategy: &CargoFmtStrategy) -> Result<HashSet<Target>, io::Error

fn get_targets_root_only(targets: &mut HashSet<Target>) -> Result<(), io::Error> {
let metadata = get_cargo_metadata(None)?;
let current_dir = env::current_dir()?;
let current_dir = env::current_dir()?.canonicalize()?;
let current_dir_manifest = current_dir.join("Cargo.toml");
let workspace_root_path = PathBuf::from(&metadata.workspace_root);
let workspace_root_path = PathBuf::from(&metadata.workspace_root).canonicalize()?;
let in_workspace_root = workspace_root_path == current_dir;

for package in metadata.packages {
Expand Down

0 comments on commit ba10a4c

Please sign in to comment.