Implement From, not Into

This commit is contained in:
Chris Morgan 2022-01-25 19:21:15 +11:00
parent 2d5be08822
commit 8bc7c76088
2 changed files with 6 additions and 3 deletions

View file

@ -21,6 +21,9 @@
- Implement `Default` on `Map` (not just on `RawMap`)
- The implementation of `Into<RawMap<A>>` for `Map<A>` has been
replaced with the more general `From<Map<A>>` for `RawMap<A>`.
- Worked around the spurious `where_clauses_object_safety` future-compatibility lint that has been raised since mid-2018.
If you put `#![allow(where_clauses_object_safety)]` on your binary crates for this reason, you can remove it.

View file

@ -236,10 +236,10 @@ impl<A: ?Sized + UncheckedAnyExt> AsMut<RawMap<A>> for Map<A> {
}
}
impl<A: ?Sized + UncheckedAnyExt> Into<RawMap<A>> for Map<A> {
impl<A: ?Sized + UncheckedAnyExt> From<Map<A>> for RawMap<A> {
#[inline]
fn into(self) -> RawMap<A> {
self.raw
fn from(map: Map<A>) -> RawMap<A> {
map.raw
}
}