From: Chris Morgan Date: Tue, 25 Jan 2022 08:21:15 +0000 (+1100) Subject: Implement From, not Into X-Git-Tag: 1.0.0-beta.1~14 X-Git-Url: https://git.chrismorgan.info/anymap/commitdiff_plain/8bc7c76088639ab3a65a642f5d79ce20ef20e2f4 Implement From, not Into --- diff --git a/CHANGELOG.md b/CHANGELOG.md index 0841cfa..bb19bc9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,9 @@ - Implement `Default` on `Map` (not just on `RawMap`) +- The implementation of `Into>` for `Map` has been + replaced with the more general `From>` for `RawMap`. + - 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. diff --git a/src/lib.rs b/src/lib.rs index 31b271e..1ad840b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -236,10 +236,10 @@ impl AsMut> for Map { } } -impl Into> for Map { +impl From> for RawMap { #[inline] - fn into(self) -> RawMap { - self.raw + fn from(map: Map) -> RawMap { + map.raw } }