Skip to content

Commit

Permalink
refactor yields
Browse files Browse the repository at this point in the history
Signed-off-by: ragnyll <[email protected]>
  • Loading branch information
Ragnyll committed Jan 26, 2022
1 parent 7e9cb58 commit f333e78
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions agent/src/util/device_plugin_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ impl DevicePluginBuilderInterface for DevicePluginBuilder {

async_stream::stream! {
loop {
yield uds.accept().map_ok(|(st, _)| unix_stream::UnixStream(st)).await;
let item = uds.accept().map_ok(|(st, _)| unix_stream::UnixStream(st)).await;
yield item;
}
}
};
Expand Down Expand Up @@ -271,7 +272,8 @@ pub mod tests {

async_stream::stream! {
loop {
yield uds.accept().map_ok(|(st, _)| unix_stream::UnixStream(st)).await;
let item = uds.accept().map_ok(|(st, _)| unix_stream::UnixStream(st)).await;
yield item;
}
}
};
Expand Down
3 changes: 2 additions & 1 deletion agent/src/util/registration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ pub async fn internal_run_registration_server(

async_stream::stream! {
loop {
yield uds.accept().map_ok(|(st, _)| unix_stream::UnixStream(st)).await;
let item = uds.accept().map_ok(|(st, _)| unix_stream::UnixStream(st)).await;
yield item;
}
}
};
Expand Down
3 changes: 2 additions & 1 deletion discovery-utils/src/discovery/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@ pub mod server {

async_stream::stream! {
loop {
yield uds.accept().map_ok(|(st, _)| unix_stream::UnixStream(st)).await;
let item = uds.accept().map_ok(|(st, _)| unix_stream::UnixStream(st)).await;
yield item;
}
}
};
Expand Down

0 comments on commit f333e78

Please sign in to comment.