diff --git a/quicktap/src/noise/data.rs b/quicktap/src/noise/data.rs index 8020441..499c7e1 100644 --- a/quicktap/src/noise/data.rs +++ b/quicktap/src/noise/data.rs @@ -9,8 +9,8 @@ fn pad_packet(p: &Vec) -> Vec { padded.append(&mut vec![0u8; 16 - (p.len() % 16)]); padded } -fn unpad_packet(p: &Vec) -> Vec { - p.into_iter().rev().skip_while(|x| **x == 0).map(|x| x.clone()).collect::>() +fn unpad_packet(p: &[u8]) -> Vec { + p.iter().rev().skip_while(|x| **x == 0).copied().collect::>() } /// Given any arbitrary IP packet, pad and encrypt it with the current handshake state. diff --git a/quicktap/src/noise/handshake/mod.rs b/quicktap/src/noise/handshake/mod.rs index 1649a6f..26fa284 100644 --- a/quicktap/src/noise/handshake/mod.rs +++ b/quicktap/src/noise/handshake/mod.rs @@ -3,7 +3,7 @@ use std::fmt::{Debug, Formatter}; use rand::rngs::OsRng; use tai64::Tai64N; -use x25519_dalek::{EphemeralSecret, PublicKey, StaticSecret}; +use x25519_dalek::{PublicKey, StaticSecret}; use crate::qcrypto::hkdf::qcrypto_hkdf; use crate::qcrypto::timestamp;