forked from AbleOS/holey-bytes
improving one particular error message
This commit is contained in:
parent
6fc0eb3498
commit
6e30968c54
|
@ -1128,11 +1128,7 @@ pub fn parse_from_fs(extra_threads: usize, root: &str) -> io::Result<Vec<Ast>> {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
path.canonicalize().map_err(|source| CantLoadFile {
|
path.canonicalize().map_err(|source| CantLoadFile { path, source })
|
||||||
path,
|
|
||||||
from: PathBuf::from(from),
|
|
||||||
source,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1164,18 +1160,12 @@ pub fn parse_from_fs(extra_threads: usize, root: &str) -> io::Result<Vec<Ast>> {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct CantLoadFile {
|
struct CantLoadFile {
|
||||||
path: PathBuf,
|
path: PathBuf,
|
||||||
from: PathBuf,
|
|
||||||
source: io::Error,
|
source: io::Error,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl std::fmt::Display for CantLoadFile {
|
impl std::fmt::Display for CantLoadFile {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||||
write!(
|
write!(f, "can't load file: {}", parser::display_rel_path(&self.path),)
|
||||||
f,
|
|
||||||
"can't load file: {} (from: {})",
|
|
||||||
parser::display_rel_path(&self.path),
|
|
||||||
parser::display_rel_path(&self.from),
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue