mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 21:23:56 +00:00
tests/ui/let_unit: fix comment and example code
The previous version would had deadlocked as the Sender remained alive and iterator would had never became complete. Just in case someone decided to run it.
This commit is contained in:
parent
a5147e8a08
commit
171f7b4eb7
1 changed files with 3 additions and 1 deletions
|
@ -33,9 +33,11 @@ fn consume_units_with_for_loop() {
|
|||
}
|
||||
assert_eq!(count, 3);
|
||||
|
||||
// Same for consuming from some other Iterator<()>.
|
||||
// Same for consuming from some other Iterator<Item = ()>.
|
||||
let (tx, rx) = ::std::sync::mpsc::channel();
|
||||
tx.send(()).unwrap();
|
||||
drop(tx);
|
||||
|
||||
count = 0;
|
||||
for _ in rx.iter() {
|
||||
count += 1;
|
||||
|
|
Loading…
Reference in a new issue