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:
Christophe de Dinechin 2024-03-25 16:56:41 +01:00
parent df5c88cdf0
commit 82c4079fd0

View File

@ -144,11 +144,9 @@ 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");
@ -156,4 +154,3 @@ mod tests {
}
}
}
}