Repository: serde-rs/json (language: rust)

Issue:
Implement IntoValues and inner converter for Map
Hi @dtolnay!

I'm using the `map.rs` file in my personal project today, and I made some changes that may be useful for the upstream:

```rust
impl<K, V> From<MapImpl<K, V>> for Map<K, V> {
    fn from(map: MapImpl<K, V>) -> Self {
        Map { map }
    }
}

impl Map<String, Value> {
    /// Consumes the `Map`, returning the underlying Map implementation.
    pub fn into_inner(self) -> MapImpl {
        self.map
    }

    /// Gets an iterator over the values of the map.
    #[inline]
    pub fn into_values(self) -> IntoValues {
        IntoValues {
            iter: self.map.into_values(),
        }
    }
}

/// An owning iterator over a serde_json::Map's values.
pub struct IntoValues {
    iter: IntoValuesImpl,
}

#[cfg(not(feature = "preserve_order"))]
type IntoValuesImpl = btree_map::IntoValues<String, Value>;
#[cfg(feature = "preserve_order")]
type IntoValuesImpl = indexmap::map::IntoValues<String, Value>;

delegate_iterator!((IntoValues) => Value);
```

I'm willing to send a PR if this is desired to be included in the upstream.

Besides, the clippy workaround for derivable_impls seems resolved now. I remove it and no more new warnings.


Discussion / hints:
`into_values` would be fine. The other 2 APIs in your suggestion would be misguided to add in serde_json. Either of those makes indexmap upgrades such as https://github.com/serde-rs/json/pull/1031 only doable across a major version of serde_json which is too disruptive.

Fix patch:
diff --git a/src/map.rs b/src/map.rs
index bc9a9307b..126e8001a 100644
--- a/src/map.rs
+++ b/src/map.rs
@@ -338,6 +338,14 @@ impl Map<String, Value> {
         }
     }
 
+    /// Gets an iterator over the values of the map.
+    #[inline]
+    pub fn into_values(self) -> IntoValues {
+        IntoValues {
+            iter: self.map.into_values(),
+        }
+    }
+
     /// Retains only the elements specified by the predicate.
     ///
     /// In other words, remove all pairs `(k, v)` such that `f(&k, &mut v)`
@@ -1155,3 +1163,17 @@ type ValuesMutImpl<'a> = btree_map::ValuesMut<'a, String, Value>;
 type ValuesMutImpl<'a> = indexmap::map::ValuesMut<'a, String, Value>;
 
 delegate_iterator!((ValuesMut<'a>) => &'a mut Value);
+
+//////////////////////////////////////////////////////////////////////////////
+
+/// An owning iterator over a serde_json::Map's values.
+pub struct IntoValues {
+    iter: IntoValuesImpl,
+}
+
+#[cfg(not(feature = "preserve_order"))]
+type IntoValuesImpl = btree_map::IntoValues<String, Value>;
+#[cfg(feature = "preserve_order")]
+type IntoValuesImpl = indexmap::map::IntoValues<String, Value>;
+
+delegate_iterator!((IntoValues) => Value);


Test patch: