From 8d2e6afec4a0ac67a2e6233025a0b91d8633c0f1 Mon Sep 17 00:00:00 2001 From: core Date: Mon, 19 Dec 2022 21:43:32 -0500 Subject: [PATCH] [quicktap][fixup] warning cleanup --- quicktap/src/noise/data.rs | 4 ++-- quicktap/src/noise/handshake/mod.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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;