Skip to content

Commit 22147a5

Browse files
committed
Use listener.accept()
During test network simulation we only accept a single connection, we can simplify the code by using `accept`. Done as a follow up to review suggestion: rust-bitcoin/rust-bitcoin#1042 (comment)
1 parent 9ee7b33 commit 22147a5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/network/stream_reader.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ mod test {
193193
// in async mode
194194
let handle = thread::spawn(move || {
195195
// We only simulate a single connection.
196-
let mut ostream = listener.incoming().next().unwrap().unwrap();
196+
let (mut ostream, _) = listener.accept().unwrap();
197197
for piece in pieces {
198198
ostream.write_all(&piece[..]).unwrap();
199199
ostream.flush().unwrap();

0 commit comments

Comments
 (0)