feat: add &str utf8 conv error to LibError enum
This commit is contained in:
parent
9b80902390
commit
2d3a19c60d
1 changed files with 8 additions and 0 deletions
|
@ -4,6 +4,7 @@ pub enum LibError {
|
|||
InvalidUrlError(InvalidUrl),
|
||||
StatusOutOfRange(u8),
|
||||
MessageNotUtf8(std::string::FromUtf8Error),
|
||||
BodyNotUtf8(std::str::Utf8Error),
|
||||
InvalidMime(mime::FromStrError),
|
||||
}
|
||||
|
||||
|
@ -42,6 +43,13 @@ impl From<std::string::FromUtf8Error> for LibError {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<std::str::Utf8Error> for LibError {
|
||||
#[inline]
|
||||
fn from(err: std::str::Utf8Error) -> Self {
|
||||
Self::BodyNotUtf8(err)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<mime::FromStrError> for LibError {
|
||||
#[inline]
|
||||
fn from(err: mime::FromStrError) -> Self {
|
||||
|
|
Loading…
Reference in a new issue