diff --git a/README.md b/README.md index ff50ef7..fda22c7 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Unit + integration test coverage is currently well above 90%, please ensure that ### Benchmarks -To run benchmarks, use: +To run benchmarks, use: ``` cargo bench @@ -40,3 +40,7 @@ test tests::bench_process ... bench: 157.322 us/iter * `1000000 / 386.348` = ~2588 packet creations per second * `1000000 / 157.322` = ~6356 packet unwrappings per second + + +### Acknowledgments +This code has received partial funding from the Next Generation Internet POINTER programme of the European Commission, as part of the Horizon 2020 Research and Innovation Programme, under Grant Agreement NÂș 871528. diff --git a/src/header/delays.rs b/src/header/delays.rs index 4f87d05..6f06b69 100644 --- a/src/header/delays.rs +++ b/src/header/delays.rs @@ -19,7 +19,7 @@ use std::{borrow::Borrow, time::Duration}; // TODO: once we get to proper refactoring, I think this should just be // a type alias to probably time::Duration -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, PartialEq, Eq)] pub struct Delay(u64); impl Delay { diff --git a/src/header/filler.rs b/src/header/filler.rs index f6a82f5..2712f7a 100644 --- a/src/header/filler.rs +++ b/src/header/filler.rs @@ -19,7 +19,7 @@ use crate::{constants, utils}; pub const FILLER_STEP_SIZE_INCREASE: usize = NODE_META_INFO_SIZE + HEADER_INTEGRITY_MAC_SIZE; -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub struct Filler { value: Vec, } diff --git a/src/header/routing/nodes.rs b/src/header/routing/nodes.rs index 31358ff..c0c7416 100644 --- a/src/header/routing/nodes.rs +++ b/src/header/routing/nodes.rs @@ -206,7 +206,7 @@ impl RawRoutingInformation { FINAL_HOP => Ok(self.parse_as_final_hop()), _ => Err(Error::new( ErrorKind::InvalidRouting, - format!("tried to parse unknown routing flag: {}", flag), + format!("tried to parse unknown routing flag: {flag}"), )), } } diff --git a/src/payload/mod.rs b/src/payload/mod.rs index e9e6153..3bb84c9 100644 --- a/src/payload/mod.rs +++ b/src/payload/mod.rs @@ -111,7 +111,7 @@ impl Payload { if let Err(err) = lioness_cipher.encrypt(&mut self.0) { return Err(Error::new( ErrorKind::InvalidPayload, - format!("error while encrypting payload - {}", err), + format!("error while encrypting payload - {err}"), )); }; Ok(self) @@ -127,7 +127,7 @@ impl Payload { if let Err(err) = lioness_cipher.decrypt(&mut self.0) { return Err(Error::new( ErrorKind::InvalidPayload, - format!("error while unwrapping payload - {}", err), + format!("error while unwrapping payload - {err}"), )); }; Ok(self) diff --git a/src/route.rs b/src/route.rs index 43c29d9..216019b 100644 --- a/src/route.rs +++ b/src/route.rs @@ -32,7 +32,7 @@ impl DestinationAddressBytes { Err(e) => { return Err(Error::new( ErrorKind::InvalidRouting, - format!("failed to decode destination from b58 string: {:?}", e), + format!("failed to decode destination from b58 string: {e:?}"), )) } }; @@ -100,7 +100,7 @@ impl NodeAddressBytes { Err(e) => { return Err(Error::new( ErrorKind::InvalidRouting, - format!("failed to decode node address from b58 string: {:?}", e), + format!("failed to decode node address from b58 string: {e:?}"), )) } }; @@ -156,7 +156,7 @@ impl Display for NodeAddressBytes { // in paper I pub type SURBIdentifier = [u8; IDENTIFIER_LENGTH]; -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub struct Destination { // address in theory could be changed to a vec as it does not need to be strictly DESTINATION_ADDRESS_LENGTH long // but cannot be longer than that (assuming longest possible route) diff --git a/src/surb/mod.rs b/src/surb/mod.rs index 7a88f57..dfe3e36 100644 --- a/src/surb/mod.rs +++ b/src/surb/mod.rs @@ -28,8 +28,8 @@ impl fmt::Debug for SURB { write!( f, - "SURB: {{ SURB_header: {:?}, first_hop_address: {:?}, payload_keys: {:?} }}", - self.SURB_header, self.first_hop_address, formatted_keys + "SURB: {{ SURB_header: {:?}, first_hop_address: {:?}, payload_keys: {formatted_keys:?} }}", + self.SURB_header, self.first_hop_address ) } }