Rollup merge of #64836 - lzutao:stabilize-map_get_key_value, r=SimonSapin

Stabilize map_get_key_value feature

FCP done in https://github.com/rust-lang/rust/issues/49347#issuecomment-521728031
r? @SimonSapin
Closes #49347
This commit is contained in:
Mazdak Farrokhzad 2019-09-28 05:37:54 +02:00 committed by GitHub
commit 494a8a8525
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View file

@ -580,7 +580,6 @@ impl<K: Ord, V> BTreeMap<K, V> {
/// # Examples
///
/// ```
/// #![feature(map_get_key_value)]
/// use std::collections::BTreeMap;
///
/// let mut map = BTreeMap::new();
@ -588,7 +587,7 @@ impl<K: Ord, V> BTreeMap<K, V> {
/// assert_eq!(map.get_key_value(&1), Some((&1, &"a")));
/// assert_eq!(map.get_key_value(&2), None);
/// ```
#[unstable(feature = "map_get_key_value", issue = "49347")]
#[stable(feature = "map_get_key_value", since = "1.40.0")]
pub fn get_key_value<Q: ?Sized>(&self, k: &Q) -> Option<(&K, &V)>
where K: Borrow<Q>,
Q: Ord

View file

@ -714,7 +714,6 @@ where
/// # Examples
///
/// ```
/// #![feature(map_get_key_value)]
/// use std::collections::HashMap;
///
/// let mut map = HashMap::new();
@ -722,7 +721,7 @@ where
/// assert_eq!(map.get_key_value(&1), Some((&1, &"a")));
/// assert_eq!(map.get_key_value(&2), None);
/// ```
#[unstable(feature = "map_get_key_value", issue = "49347")]
#[stable(feature = "map_get_key_value", since = "1.40.0")]
#[inline]
pub fn get_key_value<Q: ?Sized>(&self, k: &Q) -> Option<(&K, &V)>
where