diff --git a/.gitignore b/.gitignore index 29c90d8f..2c32b890 100644 --- a/.gitignore +++ b/.gitignore @@ -4,5 +4,6 @@ *.swo .cargo .vscode +.idea rls*.log tarpaulin-report.html diff --git a/src/features/impl_alloc.rs b/src/features/impl_alloc.rs index f5186a76..3084eae0 100644 --- a/src/features/impl_alloc.rs +++ b/src/features/impl_alloc.rs @@ -451,6 +451,13 @@ where } } +impl Decode for Rc { + fn decode(decoder: &mut D) -> Result { + let decoded = String::decode(decoder)?; + Ok(decoded.into()) + } +} + impl<'de, T> BorrowDecode<'de> for Rc where T: BorrowDecode<'de>, @@ -461,6 +468,13 @@ where } } +impl<'de> BorrowDecode<'de> for Rc { + fn borrow_decode>(decoder: &mut D) -> Result { + let decoded = String::decode(decoder)?; + Ok(decoded.into()) + } +} + impl Encode for Rc where T: Encode + ?Sized,