From 8bc7c76088639ab3a65a642f5d79ce20ef20e2f4 Mon Sep 17 00:00:00 2001 From: Chris Morgan Date: Tue, 25 Jan 2022 19:21:15 +1100 Subject: [PATCH] Implement From, not Into --- CHANGELOG.md | 3 +++ src/lib.rs | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) 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 } } -- 2.42.0