]> git.lizzy.rs Git - rust.git/blobdiff - library/std/src/collections/hash/map.rs
Auto merge of #90579 - cjgillot:no-ee-ii, r=Aaron1011
[rust.git] / library / std / src / collections / hash / map.rs
index 01019344f4f67b2dff83edcee55e9b18acd1495c..12246b5173d394058c21dba7ef05acf70e110900 100644 (file)
@@ -1707,6 +1707,7 @@ pub fn and_modify<F>(self, f: F) -> Self
 impl<'a, K, V, S> RawOccupiedEntryMut<'a, K, V, S> {
     /// Gets a reference to the key in the entry.
     #[inline]
+    #[must_use]
     #[unstable(feature = "hash_raw_entry", issue = "56167")]
     pub fn key(&self) -> &K {
         self.base.key()
@@ -1714,6 +1715,7 @@ pub fn key(&self) -> &K {
 
     /// Gets a mutable reference to the key in the entry.
     #[inline]
+    #[must_use]
     #[unstable(feature = "hash_raw_entry", issue = "56167")]
     pub fn key_mut(&mut self) -> &mut K {
         self.base.key_mut()
@@ -1730,6 +1732,7 @@ pub fn into_key(self) -> &'a mut K {
 
     /// Gets a reference to the value in the entry.
     #[inline]
+    #[must_use]
     #[unstable(feature = "hash_raw_entry", issue = "56167")]
     pub fn get(&self) -> &V {
         self.base.get()
@@ -1746,6 +1749,7 @@ pub fn into_mut(self) -> &'a mut V {
 
     /// Gets a mutable reference to the value in the entry.
     #[inline]
+    #[must_use]
     #[unstable(feature = "hash_raw_entry", issue = "56167")]
     pub fn get_mut(&mut self) -> &mut V {
         self.base.get_mut()
@@ -1753,6 +1757,7 @@ pub fn get_mut(&mut self) -> &mut V {
 
     /// Gets a reference to the key and value in the entry.
     #[inline]
+    #[must_use]
     #[unstable(feature = "hash_raw_entry", issue = "56167")]
     pub fn get_key_value(&mut self) -> (&K, &V) {
         self.base.get_key_value()