Skip to content

Commit

Permalink
re-enable convert::From<Utf8Error> on no-alloc
Browse files Browse the repository at this point in the history
  • Loading branch information
dwrensha committed Jul 3, 2023
1 parent 579b4f4 commit 678a0b8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions capnp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -477,10 +477,9 @@ impl core::convert::From<alloc::string::FromUtf8Error> for Error {
}
}

#[cfg(feature = "alloc")]
impl core::convert::From<alloc::str::Utf8Error> for Error {
fn from(err: alloc::str::Utf8Error) -> Self {
Self::failed(format!("{err}"))
impl core::convert::From<core::str::Utf8Error> for Error {
fn from(err: core::str::Utf8Error) -> Self {
Self::from_kind(ErrorKind::TextContainsNonUtf8Data(err))
}
}

Expand Down

0 comments on commit 678a0b8

Please sign in to comment.