From 6e30968c54f648a24404e1c144fb8271d7cb146f Mon Sep 17 00:00:00 2001 From: mlokr Date: Wed, 18 Sep 2024 10:14:17 +0200 Subject: [PATCH] improving one particular error message --- hblang/src/lib.rs | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/hblang/src/lib.rs b/hblang/src/lib.rs index 544ef9a..96ab460 100644 --- a/hblang/src/lib.rs +++ b/hblang/src/lib.rs @@ -1128,11 +1128,7 @@ pub fn parse_from_fs(extra_threads: usize, root: &str) -> io::Result> { } }; - path.canonicalize().map_err(|source| CantLoadFile { - path, - from: PathBuf::from(from), - source, - }) + path.canonicalize().map_err(|source| CantLoadFile { path, source }) } } @@ -1164,18 +1160,12 @@ pub fn parse_from_fs(extra_threads: usize, root: &str) -> io::Result> { #[derive(Debug)] struct CantLoadFile { path: PathBuf, - from: PathBuf, source: io::Error, } impl std::fmt::Display for CantLoadFile { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - write!( - f, - "can't load file: {} (from: {})", - parser::display_rel_path(&self.path), - parser::display_rel_path(&self.from), - ) + write!(f, "can't load file: {}", parser::display_rel_path(&self.path),) } }