Fix error messages on Windows
This commit is contained in:
parent
20b990d297
commit
0dacb2d151
@ -121,10 +121,9 @@ impl Loader for FsLoader {
|
||||
}
|
||||
|
||||
fn resolve(&self, path: &Path) -> io::Result<FileHash> {
|
||||
let file = File::open(path)?;
|
||||
let meta = file.metadata()?;
|
||||
let meta = fs::metadata(path)?;
|
||||
if meta.is_file() {
|
||||
let handle = Handle::from_file(file)?;
|
||||
let handle = Handle::from_path(path)?;
|
||||
Ok(FileHash(fxhash::hash64(&handle)))
|
||||
} else {
|
||||
Err(io::ErrorKind::NotFound.into())
|
||||
|
@ -316,7 +316,11 @@ fn test_part(
|
||||
let mut errors: Vec<_> = errors
|
||||
.into_iter()
|
||||
.filter(|error| error.span.source() == id)
|
||||
.map(|error| (ctx.sources.range(error.span), error.message))
|
||||
.map(|error| {
|
||||
let range = ctx.sources.range(error.span);
|
||||
let msg = error.message.replace("\\", "/");
|
||||
(range, msg)
|
||||
})
|
||||
.collect();
|
||||
|
||||
errors.sort_by_key(|error| error.0.start);
|
||||
|
Loading…
Reference in New Issue
Block a user