Skip to content

Commit 0076504

Browse files
committed
remove bounds from vec and linkedlist ExtractIf
since drain-on-drop behavior was removed those bounds no longer serve a purpose
1 parent 19aae9f commit 0076504

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

library/alloc/src/collections/linked_list.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -1939,8 +1939,7 @@ pub struct ExtractIf<
19391939
T: 'a,
19401940
F: 'a,
19411941
#[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global,
1942-
> where
1943-
F: FnMut(&mut T) -> bool,
1942+
>
19441943
{
19451944
list: &'a mut LinkedList<T, A>,
19461945
it: Option<NonNull<Node<T>>>,
@@ -1980,8 +1979,6 @@ where
19801979

19811980
#[unstable(feature = "extract_if", reason = "recently added", issue = "43244")]
19821981
impl<T: fmt::Debug, F> fmt::Debug for ExtractIf<'_, T, F>
1983-
where
1984-
F: FnMut(&mut T) -> bool,
19851982
{
19861983
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
19871984
f.debug_tuple("ExtractIf").field(&self.list).finish()

library/alloc/src/vec/extract_if.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ pub struct ExtractIf<
2424
T,
2525
F,
2626
#[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global,
27-
> where
28-
F: FnMut(&mut T) -> bool,
27+
>
2928
{
3029
pub(super) vec: &'a mut Vec<T, A>,
3130
/// The index of the item that will be inspected by the next call to `next`.
@@ -41,8 +40,6 @@ pub struct ExtractIf<
4140
}
4241

4342
impl<'a, T, F, A: Allocator> ExtractIf<'a, T, F, A>
44-
where
45-
F: FnMut(&mut T) -> bool,
4643
{
4744
pub(super) fn new<R: RangeBounds<usize>>(vec: &'a mut Vec<T, A>, pred: F, range: R) -> Self {
4845
let old_len = vec.len();
@@ -101,8 +98,6 @@ where
10198

10299
#[unstable(feature = "extract_if", reason = "recently added", issue = "43244")]
103100
impl<T, F, A: Allocator> Drop for ExtractIf<'_, T, F, A>
104-
where
105-
F: FnMut(&mut T) -> bool,
106101
{
107102
fn drop(&mut self) {
108103
unsafe {

0 commit comments

Comments
 (0)