Skip to content

Commit

Permalink
remove trivial warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
simonwicky committed Apr 16, 2024
1 parent a0fef52 commit 0184322
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/header/delays.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ mod delay_summing {
let delay2 = Delay(123);

let expected1 = Delay(165);
assert_eq!(expected1, &delay1 + &delay2);
assert_eq!(expected1, delay1 + delay2);

let expected2 = Delay(265);
let delay3 = Delay(100);
Expand All @@ -185,7 +185,7 @@ mod delay_summing {

#[test]
fn works_with_iterator() {
let delays = vec![Delay(42), Delay(123), Delay(100)];
let delays = [Delay(42), Delay(123), Delay(100)];
let expected = Delay(265);

assert_eq!(expected, delays.iter().sum());
Expand Down
4 changes: 2 additions & 2 deletions src/header/filler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ mod test_creating_pseudorandom_bytes {

#[test]
fn with_1_key_it_generates_filler_of_length_1_times_3_times_security_parameter() {
let shared_keys = vec![PublicKey::from(&StaticSecret::random())];
let shared_keys = [PublicKey::from(&StaticSecret::random())];
let routing_keys: Vec<_> = shared_keys
.iter()
.map(|&key| keys::RoutingKeys::derive(key))
Expand All @@ -114,7 +114,7 @@ mod test_creating_pseudorandom_bytes {

#[test]
fn with_3_key_it_generates_filler_of_length_3_times_3_times_security_parameter() {
let shared_keys = vec![
let shared_keys = [
PublicKey::from(&StaticSecret::random()),
PublicKey::from(&StaticSecret::random()),
PublicKey::from(&StaticSecret::random()),
Expand Down
2 changes: 1 addition & 1 deletion src/header/routing/destination.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ impl FinalRoutingInformation {
// return D || I || PAD
PaddedFinalRoutingInformation {
value: std::iter::once(self.flag)
.chain(self.version.to_bytes().into_iter())
.chain(self.version.to_bytes())
.chain(self.destination.as_bytes().iter().cloned())
.chain(self.identifier.iter().cloned())
.chain(padding.iter().cloned())
Expand Down
2 changes: 1 addition & 1 deletion src/header/routing/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ mod encapsulating_forward_routing_information {
let delay0 = Delay::new_from_nanos(10);
let delay1 = Delay::new_from_nanos(20);
let delay2 = Delay::new_from_nanos(30);
let delays = [delay0.clone(), delay1.clone(), delay2].to_vec();
let delays = [delay0, delay1, delay2].to_vec();
let routing_keys = [
routing_keys_fixture(),
routing_keys_fixture(),
Expand Down
2 changes: 1 addition & 1 deletion src/header/routing/nodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ impl RoutingInformation {
.chain(self.version.to_bytes().iter().cloned())
.chain(self.node_address.as_bytes_ref().iter().cloned())
.chain(self.delay.to_bytes().iter().cloned())
.chain(self.header_integrity_mac.into_inner().into_iter())
.chain(self.header_integrity_mac.into_inner())
.chain(self.next_routing_information.iter().cloned())
.collect()
}
Expand Down

0 comments on commit 0184322

Please sign in to comment.