diff --git a/sv-parser-error/src/lib.rs b/sv-parser-error/src/lib.rs index 3895cc3..56fd305 100644 --- a/sv-parser-error/src/lib.rs +++ b/sv-parser-error/src/lib.rs @@ -16,7 +16,7 @@ pub enum Error { }, #[error("File could not be read as UTF8: {0:?}")] - ReadUtf8(Option), + ReadUtf8(PathBuf), #[error("Include error")] Include { diff --git a/sv-parser-pp/src/preprocess.rs b/sv-parser-pp/src/preprocess.rs index 0bf18b6..9a01eff 100644 --- a/sv-parser-pp/src/preprocess.rs +++ b/sv-parser-pp/src/preprocess.rs @@ -151,7 +151,7 @@ fn preprocess_inner, U: AsRef, V: BuildHasher>( let mut s = String::new(); if let Err(_) = reader.read_to_string(&mut s) { - Err(Error::ReadUtf8(Some(PathBuf::from(path.as_ref())))) + Err(Error::ReadUtf8(PathBuf::from(path.as_ref()))) } else { preprocess_str( &s, @@ -1123,10 +1123,10 @@ mod tests { Error::ReadUtf8(path) => { assert_eq!( path, - Some(PathBuf::from(format!( + PathBuf::from(format!( "{}/testcases/err_ReadUtf8.sv", env::var("CARGO_MANIFEST_DIR").unwrap(), - ))) + )) ); } _ => {