Skip to content

Commit 95d6009

Browse files
committed
Fix cargo clippy warnings
Signed-off-by: Gris Ge <[email protected]>
1 parent 3c6fc4e commit 95d6009

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

examples/dump_links_async.rs

+3-7
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ async fn main() -> Result<(), String> {
2020

2121
// Spawn the `Connection` so that it starts polling the netlink
2222
// socket in the background.
23-
let _ = async_std::task::spawn(conn);
23+
async_std::task::spawn(conn);
2424

2525
// Create the netlink message that requests the links to be dumped
2626
let mut nl_hdr = NetlinkHeader::default();
@@ -36,12 +36,8 @@ async fn main() -> Result<(), String> {
3636
.map_err(|e| format!("Failed to send request: {}", e))?;
3737

3838
// Print all the messages received in response
39-
loop {
40-
if let Some(packet) = response.next().await {
41-
println!("<<< {:?}", packet);
42-
} else {
43-
break;
44-
}
39+
while let Some(packet) = response.next().await {
40+
println!("<<< {:?}", packet);
4541
}
4642

4743
Ok(())

0 commit comments

Comments
 (0)