We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8efc81e commit 4605a64Copy full SHA for 4605a64
crates/toml/src/map.rs
@@ -112,6 +112,19 @@ impl Map<String, Value> {
112
self.map.get_mut(key)
113
}
114
115
+ /// Returns the key-value pair matching the given key.
116
+ ///
117
+ /// The key may be any borrowed form of the map's key type, but the ordering
118
+ /// on the borrowed form *must* match the ordering on the key type.
119
+ #[inline]
120
+ pub fn get_key_value<Q>(&self, key: &Q) -> Option<(&String, &Value)>
121
+ where
122
+ String: Borrow<Q>,
123
+ Q: ?Sized + Ord + Eq + Hash,
124
+ {
125
+ self.map.get_key_value(key)
126
+ }
127
+
128
/// Inserts a key-value pair into the map.
129
///
130
/// If the map did not have this key present, `None` is returned.
0 commit comments