diff --git a/mycelium/src/routing_table.rs b/mycelium/src/routing_table.rs index 6ee87f7..eb314aa 100644 --- a/mycelium/src/routing_table.rs +++ b/mycelium/src/routing_table.rs @@ -249,9 +249,9 @@ impl Drop for RouteEntryGuard<'_, '_, O> { tokio::select! { _ = cancellation_token.cancelled() => {} _ = tokio::time::sleep_until(expiration) => { - debug!(route_key = ?rk, "Expired route entry for route key"); + debug!(route_key = %rk, "Expired route entry for route key"); if let Err(e) = expired_route_entry_sink.send(rk).await { - error!(route_key = ?e.0, "Failed to send expired route key on cleanup channel"); + error!(route_key = %e.0, "Failed to send expired route key on cleanup channel"); } } } @@ -586,7 +586,7 @@ impl Drop for WriteGuard<'_> { // The route list did not exist, and now it is not empty, so an entry was added. We // need to add the route list to the routing table. false if !self.value.is_empty() => { - trace!(subnet = ?self.subnet, "Inserting new route list for subnet"); + trace!(subnet = %self.subnet, "Inserting new route list for subnet"); self.writer.append(RoutingTableOplogEntry::Upsert( self.subnet, Arc::clone(&self.value), @@ -595,14 +595,14 @@ impl Drop for WriteGuard<'_> { // There was an existing route list which is now empty, so the entry for this subnet // needs to be deleted in the routing table. true if self.value.is_empty() => { - trace!(subnet = ?self.subnet, "Removing route list for subnet"); + trace!(subnet = %self.subnet, "Removing route list for subnet"); self.writer .append(RoutingTableOplogEntry::Delete(self.subnet)); } // The value already existed, and was mutably accessed, so it was dissociated. Update // the routing table to point to the new value. true => { - trace!(subnet = ?self.subnet, "Updating route list for subnet"); + trace!(subnet = %self.subnet, "Updating route list for subnet"); self.writer.append(RoutingTableOplogEntry::Upsert( self.subnet, Arc::clone(&self.value), @@ -611,7 +611,7 @@ impl Drop for WriteGuard<'_> { // The value did not exist and is still empty, so nothing was added. Nothing to do // here. false => { - trace!(subnet = ?self.subnet, "Unknown subnet had no routes and still doesn't have any"); + trace!(subnet = %self.subnet, "Unknown subnet had no routes and still doesn't have any"); } } diff --git a/mycelium/src/routing_table/iter_mut.rs b/mycelium/src/routing_table/iter_mut.rs index 67cb353..d280288 100644 --- a/mycelium/src/routing_table/iter_mut.rs +++ b/mycelium/src/routing_table/iter_mut.rs @@ -139,13 +139,13 @@ impl Drop for RoutingTableIterMutEntry<'_> { // There was an existing route list which is now empty, so the entry for this subnet // needs to be deleted in the routing table. if self.value.is_empty() { - trace!(subnet = ?self.subnet, "Removing route list for subnet"); + trace!(subnet = %self.subnet, "Removing route list for subnet"); writer.append(RoutingTableOplogEntry::Delete(self.subnet)); } // The value already existed, and was mutably accessed, so it was dissociated. Update // the routing table to point to the new value. else { - trace!(subnet = ?self.subnet, "Updating route list for subnet"); + trace!(subnet = %self.subnet, "Updating route list for subnet"); writer.append(RoutingTableOplogEntry::Upsert( self.subnet, Arc::clone(&self.value), @@ -242,9 +242,9 @@ impl Drop for IterRouteEntryGuard<'_, '_, O> { tokio::select! { _ = cancellation_token.cancelled() => {} _ = tokio::time::sleep_until(expiration) => { - debug!(route_key = ?rk, "Expired route entry for route key"); + debug!(route_key = %rk, "Expired route entry for route key"); if let Err(e) = expired_route_entry_sink.send(rk).await { - error!(route_key = ?e.0, "Failed to send expired route key on cleanup channel"); + error!(route_key = %e.0, "Failed to send expired route key on cleanup channel"); } } } diff --git a/mycelium/src/seqno_cache.rs b/mycelium/src/seqno_cache.rs index c0aa1ec..83bb643 100644 --- a/mycelium/src/seqno_cache.rs +++ b/mycelium/src/seqno_cache.rs @@ -87,7 +87,7 @@ impl SeqnoCache { info.targets.push(target); } else { debug!( - seqno_request = ?request, + seqno_request = %request, "Already sent seqno request to target {}", target.connection_identifier() ); @@ -96,7 +96,7 @@ impl SeqnoCache { if !info.sources.contains(&source) { info.sources.push(source); } else { - debug!(seqno_request = ?request, "Peer {} is requesting the same seqno again", source.connection_identifier()); + debug!(seqno_request = %request, "Peer {} is requesting the same seqno again", source.connection_identifier()); } } } diff --git a/mycelium/src/subnet.rs b/mycelium/src/subnet.rs index 35a40a0..1e89be8 100644 --- a/mycelium/src/subnet.rs +++ b/mycelium/src/subnet.rs @@ -148,14 +148,6 @@ impl fmt::Display for Subnet { } } -impl fmt::Display for PrefixLenError { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.write_str("Invalid prefix length for this address") - } -} - -impl std::error::Error for PrefixLenError {} - impl PartialEq for Subnet { fn eq(&self, other: &Self) -> bool { // Quic check, subnets of different sizes are never equal. @@ -178,6 +170,14 @@ impl Hash for Subnet { } } +impl fmt::Display for PrefixLenError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.write_str("Invalid prefix length for this address") + } +} + +impl std::error::Error for PrefixLenError {} + #[cfg(test)] mod tests { use std::net::{Ipv4Addr, Ipv6Addr};