Merge pull request #1446 from BusyJay/fix-file-lines-check

fix path check
This commit is contained in:
Nick Cameron 2017-04-10 09:32:09 +12:00 committed by GitHub
commit b4833a8c58

View File

@ -367,7 +367,16 @@ fn determine_operation(matches: &Matches) -> FmtResult<Operation> {
});
}
let files: Vec<_> = matches.free.iter().map(PathBuf::from).collect();
let files: Vec<_> = matches
.free
.iter()
.map(|s| {
let p = PathBuf::from(s);
// we will do comparison later, so here tries to canonicalize first
// to get the expected behavior.
p.canonicalize().unwrap_or(p)
})
.collect();
Ok(Operation::Format {
files: files,