mirror of
https://github.com/kata-containers/kata-containers.git
synced 2026-03-18 10:44:10 +00:00
agent: Remove useless loop
This is the report from `make check`:
```
error: this loop never actually loops
--> src/signal.rs:147:9
|
147 | / loop {
148 | | select! {
149 | | _ = handle => {
150 | | println!("INFO: task completed");
... |
156 | | }
157 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#never_loop
= note: `#[deny(clippy::never_loop)]` on by default
```
There is only one option: you get something or a timeout. You never retry, so
the report is correct.
Fixes: #9342
Signed-off-by: Christophe de Dinechin <dinechin@redhat.com>
This commit is contained in:
@@ -144,15 +144,12 @@ mod tests {
|
||||
|
||||
tx.send(true).expect("failed to request shutdown");
|
||||
|
||||
loop {
|
||||
select! {
|
||||
_ = handle => {
|
||||
println!("INFO: task completed");
|
||||
break;
|
||||
},
|
||||
_ = &mut timeout => {
|
||||
panic!("signal thread failed to stop");
|
||||
}
|
||||
select! {
|
||||
_ = handle => {
|
||||
println!("INFO: task completed");
|
||||
},
|
||||
_ = &mut timeout => {
|
||||
panic!("signal thread failed to stop");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user