We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b46c147 + c5f07ed commit b4833a8Copy full SHA for b4833a8
src/bin/rustfmt.rs
@@ -367,7 +367,16 @@ fn determine_operation(matches: &Matches) -> FmtResult<Operation> {
367
});
368
}
369
370
- let files: Vec<_> = matches.free.iter().map(PathBuf::from).collect();
+ let files: Vec<_> = matches
371
+ .free
372
+ .iter()
373
+ .map(|s| {
374
+ let p = PathBuf::from(s);
375
+ // we will do comparison later, so here tries to canonicalize first
376
+ // to get the expected behavior.
377
+ p.canonicalize().unwrap_or(p)
378
+ })
379
+ .collect();
380
381
Ok(Operation::Format {
382
files: files,
0 commit comments