forked from ROMEO/nexosim
auto-fix clippy::uneccesary_fold
This commit is contained in:
parent
c75d92145e
commit
1b3966b5ae
@ -672,7 +672,7 @@ mod tests {
|
|||||||
|
|
||||||
let th_broadcast = thread::spawn(move || {
|
let th_broadcast = thread::spawn(move || {
|
||||||
let iter = block_on(broadcaster.broadcast(MESSAGE)).unwrap();
|
let iter = block_on(broadcaster.broadcast(MESSAGE)).unwrap();
|
||||||
let sum = iter.fold(0, |acc, val| acc + val);
|
let sum = iter.sum::<usize>();
|
||||||
|
|
||||||
sum
|
sum
|
||||||
});
|
});
|
||||||
@ -727,11 +727,7 @@ mod tests {
|
|||||||
|
|
||||||
// Send messages reaching only one receiver each.
|
// Send messages reaching only one receiver each.
|
||||||
for id in 0..N_RECV {
|
for id in 0..N_RECV {
|
||||||
sum += broadcaster
|
sum += broadcaster.broadcast(id).await.unwrap().sum::<usize>();
|
||||||
.broadcast(id)
|
|
||||||
.await
|
|
||||||
.unwrap()
|
|
||||||
.fold(0, |acc, val| acc + val);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Broadcast the special value to all receivers.
|
// Broadcast the special value to all receivers.
|
||||||
@ -739,15 +735,11 @@ mod tests {
|
|||||||
.broadcast(BROADCAST_ALL)
|
.broadcast(BROADCAST_ALL)
|
||||||
.await
|
.await
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.fold(0, |acc, val| acc + val);
|
.sum::<usize>();
|
||||||
|
|
||||||
// Send again messages reaching only one receiver each.
|
// Send again messages reaching only one receiver each.
|
||||||
for id in 0..N_RECV {
|
for id in 0..N_RECV {
|
||||||
sum += broadcaster
|
sum += broadcaster.broadcast(id).await.unwrap().sum::<usize>();
|
||||||
.broadcast(id)
|
|
||||||
.await
|
|
||||||
.unwrap()
|
|
||||||
.fold(0, |acc, val| acc + val);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sum
|
sum
|
||||||
|
@ -567,7 +567,7 @@ mod tests {
|
|||||||
|
|
||||||
let th_broadcast = thread::spawn(move || {
|
let th_broadcast = thread::spawn(move || {
|
||||||
let iter = block_on(broadcaster.broadcast(MESSAGE)).unwrap();
|
let iter = block_on(broadcaster.broadcast(MESSAGE)).unwrap();
|
||||||
let sum = iter.fold(0, |acc, val| acc + val);
|
let sum = iter.sum::<usize>();
|
||||||
|
|
||||||
sum
|
sum
|
||||||
});
|
});
|
||||||
@ -622,11 +622,7 @@ mod tests {
|
|||||||
|
|
||||||
// Send messages reaching only one receiver each.
|
// Send messages reaching only one receiver each.
|
||||||
for id in 0..N_RECV {
|
for id in 0..N_RECV {
|
||||||
sum += broadcaster
|
sum += broadcaster.broadcast(id).await.unwrap().sum::<usize>();
|
||||||
.broadcast(id)
|
|
||||||
.await
|
|
||||||
.unwrap()
|
|
||||||
.fold(0, |acc, val| acc + val);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Broadcast the special value to all receivers.
|
// Broadcast the special value to all receivers.
|
||||||
@ -634,15 +630,11 @@ mod tests {
|
|||||||
.broadcast(BROADCAST_ALL)
|
.broadcast(BROADCAST_ALL)
|
||||||
.await
|
.await
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.fold(0, |acc, val| acc + val);
|
.sum::<usize>();
|
||||||
|
|
||||||
// Send again messages reaching only one receiver each.
|
// Send again messages reaching only one receiver each.
|
||||||
for id in 0..N_RECV {
|
for id in 0..N_RECV {
|
||||||
sum += broadcaster
|
sum += broadcaster.broadcast(id).await.unwrap().sum::<usize>();
|
||||||
.broadcast(id)
|
|
||||||
.await
|
|
||||||
.unwrap()
|
|
||||||
.fold(0, |acc, val| acc + val);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sum
|
sum
|
||||||
|
Loading…
x
Reference in New Issue
Block a user