From 9e1ae9ac685109431e4ed456560e27798fe4861b Mon Sep 17 00:00:00 2001 From: Louis Thiery Date: Wed, 8 Nov 2023 09:22:29 -0800 Subject: [PATCH] Removes dead code and fixes a few typos (#471) * remove dead code * typos --- src/beaconer.rs | 2 +- src/lib.rs | 11 ----------- src/packet_router/mod.rs | 2 +- src/settings.rs | 6 +++--- 4 files changed, 5 insertions(+), 16 deletions(-) diff --git a/src/beaconer.rs b/src/beaconer.rs index e2856a88..5970951f 100644 --- a/src/beaconer.rs +++ b/src/beaconer.rs @@ -146,7 +146,7 @@ impl Beaconer { self.interval, ); - // Log next beacom time if changed + // Log next beacon time if changed if Some(new_beacon_time) != self.next_beacon_time { info!(beacon_time = %new_beacon_time, "next beacon time"); } diff --git a/src/lib.rs b/src/lib.rs index dce3c23c..83c799f0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -81,14 +81,3 @@ macro_rules! impl_verify { }; } pub(crate) use impl_verify; - -// macro_rules! verify { -// ($key: expr, $msg: expr, $sig: ident) => {{ -// let mut _msg = $msg.clone(); -// _msg.$sig = vec![]; -// let buf = _msg.encode_to_vec(); -// $key.verify(&buf, &$msg.$sig).map_err(Error::from) -// }}; -// } - -// pub(crate) use verify; diff --git a/src/packet_router/mod.rs b/src/packet_router/mod.rs index 007aaba1..835b545a 100644 --- a/src/packet_router/mod.rs +++ b/src/packet_router/mod.rs @@ -133,7 +133,7 @@ impl PacketRouter { } async fn handle_reconnect(&mut self) -> Result { - // Do not send waiting packets on ok here since we wait for a sesson + // Do not send waiting packets on ok here since we wait for a session // offer. Also do not reset the reconnect retry counter since only a // session key indicates a good connection self.service diff --git a/src/settings.rs b/src/settings.rs index 0f03cb12..0b45f3e9 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -124,8 +124,8 @@ impl Settings { /// Returns the onboarding key for this gateway. The onboarding key is /// determined by the onboarding setting. If the onbaording setting is not - /// present or there is any error retrievign the onboarding key from the - /// confignred setting the public key of the gateawy is returned. + /// present or there is any error retrieving the onboarding key from the + /// configured setting the public key of the gateway is returned. pub fn onboarding_key(&self) -> PublicKey { self.onboarding.as_ref().map_or_else( || self.keypair.public_key().to_owned(), @@ -312,7 +312,7 @@ mod test { // Now try URI form assert_eq!( - Uri::try_from(&ListenAddress::Port(4468)).expect("urifrom port"), + Uri::try_from(&ListenAddress::Port(4468)).expect("uri from port"), Uri::from_static("http://127.0.0.1:4468") ); assert_eq!(