File tree 1 file changed +3
-7
lines changed
1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ async fn main() -> Result<(), String> {
20
20
21
21
// Spawn the `Connection` so that it starts polling the netlink
22
22
// socket in the background.
23
- let _ = async_std:: task:: spawn ( conn) ;
23
+ async_std:: task:: spawn ( conn) ;
24
24
25
25
// Create the netlink message that requests the links to be dumped
26
26
let mut nl_hdr = NetlinkHeader :: default ( ) ;
@@ -36,12 +36,8 @@ async fn main() -> Result<(), String> {
36
36
. map_err ( |e| format ! ( "Failed to send request: {}" , e) ) ?;
37
37
38
38
// 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) ;
45
41
}
46
42
47
43
Ok ( ( ) )
You can’t perform that action at this time.
0 commit comments