diff --git a/implementations/rust/src/value/reader.rs b/implementations/rust/src/value/reader.rs index d30e5cd..b4b4735 100644 --- a/implementations/rust/src/value/reader.rs +++ b/implementations/rust/src/value/reader.rs @@ -820,7 +820,7 @@ pub fn decodestr<'de>(cow: Cow<'de, [u8]>) -> IOResult> { Cow::Borrowed(bs) => Ok(Cow::Borrowed(std::str::from_utf8(bs).map_err(|_| io_syntax_error("Invalid UTF-8"))?)), Cow::Owned(bs) => - Ok(Cow::Owned(std::str::from_utf8(&bs).map_err(|_| io_syntax_error("Invalid UTF-8"))?.to_owned())), + Ok(Cow::Owned(String::from_utf8(bs).map_err(|_| io_syntax_error("Invalid UTF-8"))?.to_owned())), } } @@ -829,7 +829,7 @@ pub fn decodebinary<'de>(minor: AtomMinor, bs: Cow<'de, [u8]>) -> IOResult Value::from(&BigInt::from_signed_bytes_be(&bs)).wrap(), AtomMinor::String => Value::String(decodestr(bs)?.into_owned()).wrap(), AtomMinor::ByteString => Value::ByteString(bs.into_owned()).wrap(), - AtomMinor::Symbol => Value::symbol(&decodestr(bs)?).wrap(), + AtomMinor::Symbol => Value::Symbol(decodestr(bs)?.into_owned()).wrap(), }) }