| error: manual implementation of `Vec::pop_if` |
| --> tests/ui/manual_pop_if_unfixable.rs:10:12 |
| | |
| LL | } else if vec.last().is_some_and(|x| *x > 2) { |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| LL | vec.pop().unwrap(); |
| | ^^^^^^^^^^^^^^^^^^ |
| | |
| = help: try refactoring the code using `vec.pop_if(|x| *x > 2);` |
| = note: `-D clippy::manual-pop-if` implied by `-D warnings` |
| = help: to override `-D warnings` add `#[allow(clippy::manual_pop_if)]` |
| |
| error: manual implementation of `Vec::pop_if` |
| --> tests/ui/manual_pop_if_unfixable.rs:16:5 |
| | |
| LL | if vec.last().is_some_and(|x| *x > 2) { |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| LL | let val = vec.pop().unwrap(); |
| | ^^^^^^^^^^^^^^^^^^ |
| | |
| = help: try refactoring the code using `vec.pop_if(|x| *x > 2);` |
| |
| error: manual implementation of `Vec::pop_if` |
| --> tests/ui/manual_pop_if_unfixable.rs:22:5 |
| | |
| LL | if vec.last().is_some_and(|x| *x > 2) { |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| LL | println!("Popped: {}", vec.pop().unwrap()); |
| | ^^^^^^^^^^^^^^^^^^ |
| | |
| = help: try refactoring the code using `vec.pop_if(|x| *x > 2);` |
| |
| error: manual implementation of `Vec::pop_if` |
| --> tests/ui/manual_pop_if_unfixable.rs:27:5 |
| | |
| LL | if vec.last().is_some_and(|x| *x > 2) { |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| LL | // a comment before the pop |
| LL | vec.pop().unwrap(); |
| | ^^^^^^^^^^^^^^^^^^ |
| | |
| = help: try refactoring the code using `vec.pop_if(|x| *x > 2);` |
| |
| error: manual implementation of `Vec::pop_if` |
| --> tests/ui/manual_pop_if_unfixable.rs:33:5 |
| | |
| LL | if vec.last().is_some_and(|x| *x > 2) { |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| LL | vec.pop().unwrap(); |
| | ^^^^^^^^^^^^^^^^^^ |
| | |
| = help: try refactoring the code using `vec.pop_if(|x| *x > 2);` |
| |
| error: manual implementation of `Vec::pop_if` |
| --> tests/ui/manual_pop_if_unfixable.rs:41:5 |
| | |
| LL | if let Some(x) = vec.last() { |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| LL | if *x > 2 { |
| | ^^^^^^^^^ |
| LL | let val = vec.pop().unwrap(); |
| | ^^^^^^^^^^^^^^^^^^ |
| | |
| = help: try refactoring the code using `vec.pop_if(|x| *x > 2);` |
| |
| error: manual implementation of `Vec::pop_if` |
| --> tests/ui/manual_pop_if_unfixable.rs:49:5 |
| | |
| LL | if let Some(x) = vec.last() { |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| LL | if *x > 2 { |
| | ^^^^^^^^^ |
| LL | println!("Popped: {}", vec.pop().unwrap()); |
| | ^^^^^^^^^^^^^^^^^^ |
| | |
| = help: try refactoring the code using `vec.pop_if(|x| *x > 2);` |
| |
| error: manual implementation of `Vec::pop_if` |
| --> tests/ui/manual_pop_if_unfixable.rs:56:5 |
| | |
| LL | if let Some(x) = vec.last() { |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| LL | if *x > 2 { |
| | ^^^^^^^^^ |
| LL | // a comment before the pop |
| LL | vec.pop().unwrap(); |
| | ^^^^^^^^^^^^^^^^^^ |
| | |
| = help: try refactoring the code using `vec.pop_if(|x| *x > 2);` |
| |
| error: manual implementation of `Vec::pop_if` |
| --> tests/ui/manual_pop_if_unfixable.rs:64:5 |
| | |
| LL | if let Some(x) = vec.last() { |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| LL | if *x > 2 { |
| | ^^^^^^^^^ |
| LL | vec.pop().unwrap(); |
| | ^^^^^^^^^^^^^^^^^^ |
| | |
| = help: try refactoring the code using `vec.pop_if(|x| *x > 2);` |
| |
| error: manual implementation of `Vec::pop_if` |
| --> tests/ui/manual_pop_if_unfixable.rs:74:5 |
| | |
| LL | / if let Some(x) = vec.last() |
| LL | | && *x > 2 |
| | |_________________^ |
| LL | { |
| LL | let val = vec.pop().unwrap(); |
| | ^^^^^^^^^^^^^^^^^^ |
| | |
| = help: try refactoring the code using `vec.pop_if(|x| *x > 2);` |
| |
| error: manual implementation of `Vec::pop_if` |
| --> tests/ui/manual_pop_if_unfixable.rs:82:5 |
| | |
| LL | / if let Some(x) = vec.last() |
| LL | | && *x > 2 |
| | |_________________^ |
| LL | { |
| LL | println!("Popped: {}", vec.pop().unwrap()); |
| | ^^^^^^^^^^^^^^^^^^ |
| | |
| = help: try refactoring the code using `vec.pop_if(|x| *x > 2);` |
| |
| error: manual implementation of `Vec::pop_if` |
| --> tests/ui/manual_pop_if_unfixable.rs:89:5 |
| | |
| LL | / if let Some(x) = vec.last() |
| LL | | && *x > 2 |
| | |_________________^ |
| ... |
| LL | vec.pop().unwrap(); |
| | ^^^^^^^^^^^^^^^^^^ |
| | |
| = help: try refactoring the code using `vec.pop_if(|x| *x > 2);` |
| |
| error: manual implementation of `Vec::pop_if` |
| --> tests/ui/manual_pop_if_unfixable.rs:97:5 |
| | |
| LL | / if let Some(x) = vec.last() |
| LL | | && *x > 2 |
| | |_________________^ |
| LL | { |
| LL | vec.pop().unwrap(); |
| | ^^^^^^^^^^^^^^^^^^ |
| | |
| = help: try refactoring the code using `vec.pop_if(|x| *x > 2);` |
| |
| error: manual implementation of `Vec::pop_if` |
| --> tests/ui/manual_pop_if_unfixable.rs:107:5 |
| | |
| LL | if vec.last().map(|x| *x > 2).unwrap_or(false) { |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| LL | let val = vec.pop().unwrap(); |
| | ^^^^^^^^^^^^^^^^^^ |
| | |
| = help: try refactoring the code using `vec.pop_if(|x| *x > 2);` |
| |
| error: manual implementation of `Vec::pop_if` |
| --> tests/ui/manual_pop_if_unfixable.rs:113:5 |
| | |
| LL | if vec.last().map(|x| *x > 2).unwrap_or(false) { |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| LL | println!("Popped: {}", vec.pop().unwrap()); |
| | ^^^^^^^^^^^^^^^^^^ |
| | |
| = help: try refactoring the code using `vec.pop_if(|x| *x > 2);` |
| |
| error: manual implementation of `Vec::pop_if` |
| --> tests/ui/manual_pop_if_unfixable.rs:118:5 |
| | |
| LL | if vec.last().map(|x| *x > 2).unwrap_or(false) { |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| LL | // a comment before the pop |
| LL | vec.pop().unwrap(); |
| | ^^^^^^^^^^^^^^^^^^ |
| | |
| = help: try refactoring the code using `vec.pop_if(|x| *x > 2);` |
| |
| error: manual implementation of `Vec::pop_if` |
| --> tests/ui/manual_pop_if_unfixable.rs:124:5 |
| | |
| LL | if vec.last().map(|x| *x > 2).unwrap_or(false) { |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| LL | vec.pop().unwrap(); |
| | ^^^^^^^^^^^^^^^^^^ |
| | |
| = help: try refactoring the code using `vec.pop_if(|x| *x > 2);` |
| |
| error: aborting due to 17 previous errors |
| |