Skip to content

Commit 6a45ebf

Browse files
committed
Merge rust-bitcoin/rust-bitcoin#1119: Use listener.accept()
b1faf63 Use listener.accept() (Tobin C. Harding) Pull request description: 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) ACKs for top commit: Kixunil: ACK b1faf63 apoelstra: ACK b1faf63 Tree-SHA512: b2ead15d3108db3e01d9faab5e3521403dad6a0f4c3cf505f88fefd020110c520a89b9406484c10b04c9a34073c8abc465941577b17b5a193b54502c23b14c61
2 parents 176ee98 + 22147a5 commit 6a45ebf

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)