Skip to content

Commit

Permalink
Support frozen abi for Cow with workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
ryoqun committed Jan 11, 2023
1 parent 50269f6 commit 28a0c38
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions frozen-abi/src/abi_example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,11 +390,12 @@ impl<T: std::cmp::Ord + AbiExample, S: AbiExample> AbiExample for BTreeMap<T, S>
}
}

// impl<'a, T: AbiExample> AbiExample for std::borrow::Cow<'a, T> {
// fn example() -> Self {
// Self::Owned(T::example())
// }
// }
// + Clone is needed to work around this rustc bug: https://github.com/rust-lang/rust/issues/106710
impl<T: AbiExample + Clone> AbiExample for std::borrow::Cow<'_, T> {
fn example() -> Self {
Self::Owned(T::example())
}
}

impl<T: AbiExample> AbiExample for Vec<T> {
fn example() -> Self {
Expand Down

0 comments on commit 28a0c38

Please sign in to comment.