chiark / gitweb /
Use pop_front in drop
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 15 Nov 2024 16:11:52 +0000 (16:11 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 15 Nov 2024 16:11:52 +0000 (16:11 +0000)
src/test/demo.rs

index 6e67858521290e6be6497c6b8174db21f402193a..8185e412e4b23201f177f75f5afc5782333c4d68 100644 (file)
@@ -168,11 +168,7 @@ impl<T: Debug> List<T> {
 
 impl<T: Debug> Drop for List<T> {
     fn drop(&mut self) {
-        while let Some(_) = Self::pop_front_inner(
-            self.noalias.token_mut(),
-            &mut self.head,
-            &mut self.tail,
-        ) { }
+        while let Some(_) = self.pop_front() { }
     }
 }