mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-22 19:13:29 +00:00
15 lines
424 B
Rust
15 lines
424 B
Rust
fn main() {}
|
|
//@no-rustfix
|
|
fn no_panic<T>(slice: &[T]) {
|
|
let mut iter = slice.iter();
|
|
loop {
|
|
//~^ ERROR: this loop could be written as a `while let` loop
|
|
//~| NOTE: `-D clippy::while-let-loop` implied by `-D warnings`
|
|
let _ = match iter.next() {
|
|
Some(ele) => ele,
|
|
None => break,
|
|
};
|
|
loop {}
|
|
//~^ ERROR: empty `loop {}` wastes CPU cycles
|
|
}
|
|
}
|