Skip to content

Commit

Permalink
Auto merge of #46581 - tmccombs:drain_filter_drop, r=sfackler
Browse files Browse the repository at this point in the history
Add Drop impl for linked_list::DrainFilter

This is part of #43244. See #43244 (comment)
  • Loading branch information
bors committed Dec 9, 2017
2 parents 61cc23e + cdf1d7d commit 6537fd1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/liballoc/linked_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1071,6 +1071,15 @@ impl<'a, T, F> Iterator for DrainFilter<'a, T, F>
}
}

#[unstable(feature = "drain_filter", reason = "recently added", issue = "43244")]
impl<'a, T, F> Drop for DrainFilter<'a, T, F>
where F: FnMut(&mut T) -> bool,
{
fn drop(&mut self) {
for _ in self { }
}
}

#[unstable(feature = "drain_filter", reason = "recently added", issue = "43244")]
impl<'a, T: 'a + fmt::Debug, F> fmt::Debug for DrainFilter<'a, T, F>
where F: FnMut(&mut T) -> bool
Expand Down

0 comments on commit 6537fd1

Please sign in to comment.