diff --git a/compiler/src/error.rs b/compiler/src/error.rs index 396f70d..0c6bc16 100644 --- a/compiler/src/error.rs +++ b/compiler/src/error.rs @@ -17,6 +17,8 @@ pub enum CompilerError { IoError(#[from] io::Error), #[error(transparent)] Utf8Error(#[from] Utf8Error), + #[error(transparent)] + FromBytesUntilNulError(#[from] FromBytesUntilNulError), #[error("{message}")] GenericError { #[source] @@ -65,11 +67,3 @@ impl From for CompilerError { CompilerError::GenericError { cause, message } } } - -impl From for CompilerError { - fn from(cause: FromBytesUntilNulError) -> Self { - let message = format!("{}", cause); - let cause = Some(Box::new(cause) as Box); - CompilerError::GenericError { cause, message } - } -}