about summary refs log tree commit diff
path: root/library/alloc/src/vec
diff options
context:
space:
mode:
authorSidney Cammeresi <sac@cheesecake.org>2025-09-14 08:06:11 -0700
committerSidney Cammeresi <sac@cheesecake.org>2025-09-14 08:16:05 -0700
commitce859d7713dbca1b2a3dff17ccc4d4a0598bffbf (patch)
treefb8b175148b536bfbfc65af4d54fe9335b88195c /library/alloc/src/vec
parent52618eb338609df44978b0ca4451ab7941fd1c7a (diff)
downloadrust-ce859d7713dbca1b2a3dff17ccc4d4a0598bffbf.tar.gz
rust-ce859d7713dbca1b2a3dff17ccc4d4a0598bffbf.zip
Switch `std::vec::PeekMut::pop` from self to this parameter.
Since PeekMut implements Deref, it shouldn't have any methods of its
own.

See also: `std::collections::binary_heap::PeekMut::pop`
Diffstat (limited to 'library/alloc/src/vec')
-rw-r--r--library/alloc/src/vec/peek_mut.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/alloc/src/vec/peek_mut.rs b/library/alloc/src/vec/peek_mut.rs
index c0dd941ed39..caeaf2799d7 100644
--- a/library/alloc/src/vec/peek_mut.rs
+++ b/library/alloc/src/vec/peek_mut.rs
@@ -29,9 +29,9 @@ impl<'a, T> PeekMut<'a, T> {
 
     /// Removes the peeked value from the vector and returns it.
     #[unstable(feature = "vec_peek_mut", issue = "122742")]
-    pub fn pop(self) -> T {
+    pub fn pop(this: Self) -> T {
         // SAFETY: PeekMut is only constructed if the vec is non-empty
-        unsafe { self.vec.pop().unwrap_unchecked() }
+        unsafe { this.vec.pop().unwrap_unchecked() }
     }
 }