Skip to content

Commit c250fbd

Browse files
refactor: simplify read_some closure in TcpConnection
Updated the read_some closure to remove unnecessary mutability, enhancing code clarity and maintainability. This change contributes to the ongoing improvements in TCP connection handling.
1 parent bd12e57 commit c250fbd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dash-spv/src/network/connection.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ impl TcpConnection {
400400

401401
let result = (|| -> NetworkResult<Option<NetworkMessage>> {
402402
// Helper: try to read some bytes into framing buffer
403-
let mut read_some = |state: &mut ConnectionState| -> std::io::Result<usize> {
403+
let read_some = |state: &mut ConnectionState| -> std::io::Result<usize> {
404404
let mut tmp = [0u8; 8192];
405405
match state.read_buffer.read(&mut tmp) {
406406
Ok(0) => Ok(0),

0 commit comments

Comments
 (0)