Skip to content

Commit ad1442b

Browse files
committed
Fix clippy warnings
1 parent ee6fda6 commit ad1442b

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/session/noise/transcoder.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ impl<const LEN_SIZE: usize> NoiseEncryptor<LEN_SIZE> {
111111
let mut ciphertext = vec![
112112
0u8;
113113
Self::TAGGED_MESSAGE_LENGTH_HEADER_SIZE
114-
+ length as usize
114+
+ length
115115
+ chacha::TAG_SIZE
116116
];
117117

@@ -373,7 +373,7 @@ impl<const LEN_SIZE: usize> NoiseTranscoder<LEN_SIZE> {
373373
let (act, h) = handshake.next(&data)?;
374374
handshake = h;
375375
if let Some(ref act) = act {
376-
connection.as_sender().send_raw(&*act)?;
376+
connection.as_sender().send_raw(act)?;
377377
if let HandshakeState::Complete(transcoder) = handshake {
378378
break Ok(transcoder);
379379
}
@@ -404,7 +404,7 @@ impl<const LEN_SIZE: usize> NoiseTranscoder<LEN_SIZE> {
404404
break Ok(transcoder);
405405
}
406406
if let Some(act) = act {
407-
connection.as_sender().send_raw(&*act)?;
407+
connection.as_sender().send_raw(&act)?;
408408
data =
409409
connection.as_receiver().recv_raw(handshake.data_len())?;
410410
}

src/session/session.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,7 @@ fn recv_noise_message<const LEN_SIZE: usize>(
208208
decrypt.decrypt(encrypted_len)?;
209209
let len = decrypt.pending_message_len().ok_or(Error::NoNoiseHeader)?;
210210
// Reading & decrypting payload
211-
let encrypted_payload =
212-
reader.recv_raw(len as usize + noise::chacha::TAG_SIZE)?;
211+
let encrypted_payload = reader.recv_raw(len + noise::chacha::TAG_SIZE)?;
213212
let payload = decrypt.decrypt(encrypted_payload)?;
214213
Ok(payload)
215214
}

0 commit comments

Comments
 (0)