Skip to content

Commit fa809fb

Browse files
committed
Added range for vec.drain call
1 parent c76a20f commit fa809fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/leaking.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ let mut vec = vec![Box::new(0); 4];
7575
7676
{
7777
// start draining, vec can no longer be accessed
78-
let mut drainer = vec.drain(..);
78+
let mut drainer = vec.drain(..3);
7979
8080
// pull out two elements and immediately drop them
8181
drainer.next();

0 commit comments

Comments
 (0)