Auto merge of #46581 - tmccombs:drain_filter_drop, r=sfackler
Add Drop impl for linked_list::DrainFilter This is part of #43244. See https://github.com/rust-lang/rust/issues/43244#issuecomment-349894355
This commit is contained in:
commit
6537fd184e
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user