Skip to content

Commit 9245304

Browse files
committed
Remove unnecessary local variable
In test functions; we bind to `istream` only to re-bind immediately to `stream`, this is unnecessary and adds no additional information to the code.
1 parent e8fe83f commit 9245304

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/network/stream_reader.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,11 +225,10 @@ mod test {
225225
#[test]
226226
fn read_multipartmsg_test() {
227227
// Setting up TCP connection emulation
228-
let (handle, istream) = serve_tcp(vec![
228+
let (handle, stream) = serve_tcp(vec![
229229
// single message split in two parts to emulate real network conditions
230230
MSG_VERSION[..24].to_vec(), MSG_VERSION[24..].to_vec()
231231
]);
232-
let stream = istream;
233232
let mut reader = StreamReader::new(stream, None);
234233

235234
// Reading and checking the whole message back
@@ -243,13 +242,12 @@ mod test {
243242
#[test]
244243
fn read_sequencemsg_test() {
245244
// Setting up TCP connection emulation
246-
let (handle, istream) = serve_tcp(vec![
245+
let (handle, stream) = serve_tcp(vec![
247246
// Real-world Bitcoin core communication case for /Satoshi:0.17.1/
248247
MSG_VERSION[..23].to_vec(), MSG_VERSION[23..].to_vec(),
249248
MSG_VERACK.to_vec(),
250249
MSG_ALERT[..24].to_vec(), MSG_ALERT[24..].to_vec()
251250
]);
252-
let stream = istream;
253251
let mut reader = StreamReader::new(stream, None);
254252

255253
// Reading and checking the first message (Version)

0 commit comments

Comments
 (0)