Skip to content

Commit

Permalink
Merge branch 'trunk' into miri-check
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorKoenders committed May 1, 2024
2 parents 1098e1a + 8f65c60 commit ef28e8e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
*.swo
.cargo
.vscode
.idea
rls*.log
tarpaulin-report.html
14 changes: 14 additions & 0 deletions src/features/impl_alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,13 @@ where
}
}

impl Decode for Rc<str> {
fn decode<D: Decoder>(decoder: &mut D) -> Result<Self, DecodeError> {
let decoded = String::decode(decoder)?;
Ok(decoded.into())
}
}

impl<'de, T> BorrowDecode<'de> for Rc<T>
where
T: BorrowDecode<'de>,
Expand All @@ -461,6 +468,13 @@ where
}
}

impl<'de> BorrowDecode<'de> for Rc<str> {
fn borrow_decode<D: BorrowDecoder<'de>>(decoder: &mut D) -> Result<Self, DecodeError> {
let decoded = String::decode(decoder)?;
Ok(decoded.into())
}
}

impl<T> Encode for Rc<T>
where
T: Encode + ?Sized,
Expand Down

0 comments on commit ef28e8e

Please sign in to comment.