fromutf8error convert

This commit is contained in:
KitsuneCafe 2024-02-04 06:09:58 -05:00
parent dc17ebdb5d
commit f698687a2d

View file

@ -2,6 +2,7 @@ use std::{
fmt::Display,
io::{Error as IOError, ErrorKind},
path::StripPrefixError,
string::FromUtf8Error,
};
#[derive(Debug)]
@ -67,6 +68,15 @@ impl From<Error> for IOError {
}
}
impl From<FromUtf8Error> for Error {
fn from(value: FromUtf8Error) -> Self {
Self {
message: value.to_string(),
source: Self::wrap(value),
}
}
}
impl From<&'static dyn std::error::Error> for Error {
fn from(value: &'static dyn std::error::Error) -> Self {
Self {