Skip to content

Commit

Permalink
remove for loop
Browse files Browse the repository at this point in the history
  • Loading branch information
fightling committed Aug 28, 2024
1 parent 1497e9a commit cd9fcdc
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/backend/nc_talk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,14 @@ impl NCTalk {
rooms: &mut HashMap<String, NCRoom>,
chat_log_path: PathBuf,
) {
let mut v = Vec::new();
for child in response {
v.push(tokio::spawn(NCTalk::new_room(
let v = response.into_iter().map(|child| {
tokio::spawn(NCTalk::new_room(
child,
requester.clone(),
notifier.clone(),
chat_log_path.clone(),
)));
}
))
});
for jh in v {
let (name, room_option) = jh.await.unwrap();
if let Some(room) = room_option {
Expand Down

0 comments on commit cd9fcdc

Please sign in to comment.