mirror of
https://github.com/vosen/ZLUDA.git
synced 2025-04-20 08:24:44 +00:00
zoc: Handle FromBytesUntilNulError as transparent
This commit is contained in:
parent
69080d2abc
commit
af7139fb9c
1 changed files with 2 additions and 8 deletions
|
@ -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<TranslateError> for CompilerError {
|
|||
CompilerError::GenericError { cause, message }
|
||||
}
|
||||
}
|
||||
|
||||
impl From<FromBytesUntilNulError> for CompilerError {
|
||||
fn from(cause: FromBytesUntilNulError) -> Self {
|
||||
let message = format!("{}", cause);
|
||||
let cause = Some(Box::new(cause) as Box<dyn std::error::Error>);
|
||||
CompilerError::GenericError { cause, message }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue