Loading crates/tor-guardmgr/src/guard.rs +5 −1 Original line number Diff line number Diff line Loading @@ -194,7 +194,11 @@ impl Guard { params.lifetime_unconfirmed / 10, ); Self::new(GuardId::from_relay(relay), relay.addrs().into(), added_at) Self::new( GuardId::from_chan_target(relay), relay.addrs().into(), added_at, ) } /// Return a new, manually constructed [`Guard`]. Loading crates/tor-guardmgr/src/lib.rs +3 −3 Original line number Diff line number Diff line Loading @@ -936,9 +936,9 @@ impl GuardId { Self { ed25519, rsa } } /// Extract a GuardId from a Relay object. pub(crate) fn from_relay(relay: &tor_netdir::Relay<'_>) -> Self { Self::new(*relay.id(), *relay.rsa_id()) /// Extract a GuardId from a ChanTarget object. pub fn from_chan_target<T: tor_linkspec::ChanTarget>(target: &T) -> Self { GuardId::new(*target.ed_identity(), *target.rsa_identity()) } /// Return the relay in `netdir` that corresponds to this ID, if there Loading crates/tor-guardmgr/src/sample.rs +2 −2 Original line number Diff line number Diff line Loading @@ -235,7 +235,7 @@ impl GuardSet { fn contains_relay(&self, relay: &Relay<'_>) -> bool { // Note: Could implement Borrow instead, but I don't think it'll // matter. let id = GuardId::from_relay(relay); let id = GuardId::from_chan_target(relay); self.guards.contains_key(&id) } Loading Loading @@ -368,7 +368,7 @@ impl GuardSet { /// /// Does nothing if it is already a guard. fn add_guard(&mut self, relay: &Relay<'_>, now: SystemTime, params: &GuardParams) { let id = GuardId::from_relay(relay); let id = GuardId::from_chan_target(relay); if self.guards.contains_key(&id) { return; } Loading Loading
crates/tor-guardmgr/src/guard.rs +5 −1 Original line number Diff line number Diff line Loading @@ -194,7 +194,11 @@ impl Guard { params.lifetime_unconfirmed / 10, ); Self::new(GuardId::from_relay(relay), relay.addrs().into(), added_at) Self::new( GuardId::from_chan_target(relay), relay.addrs().into(), added_at, ) } /// Return a new, manually constructed [`Guard`]. Loading
crates/tor-guardmgr/src/lib.rs +3 −3 Original line number Diff line number Diff line Loading @@ -936,9 +936,9 @@ impl GuardId { Self { ed25519, rsa } } /// Extract a GuardId from a Relay object. pub(crate) fn from_relay(relay: &tor_netdir::Relay<'_>) -> Self { Self::new(*relay.id(), *relay.rsa_id()) /// Extract a GuardId from a ChanTarget object. pub fn from_chan_target<T: tor_linkspec::ChanTarget>(target: &T) -> Self { GuardId::new(*target.ed_identity(), *target.rsa_identity()) } /// Return the relay in `netdir` that corresponds to this ID, if there Loading
crates/tor-guardmgr/src/sample.rs +2 −2 Original line number Diff line number Diff line Loading @@ -235,7 +235,7 @@ impl GuardSet { fn contains_relay(&self, relay: &Relay<'_>) -> bool { // Note: Could implement Borrow instead, but I don't think it'll // matter. let id = GuardId::from_relay(relay); let id = GuardId::from_chan_target(relay); self.guards.contains_key(&id) } Loading Loading @@ -368,7 +368,7 @@ impl GuardSet { /// /// Does nothing if it is already a guard. fn add_guard(&mut self, relay: &Relay<'_>, now: SystemTime, params: &GuardParams) { let id = GuardId::from_relay(relay); let id = GuardId::from_chan_target(relay); if self.guards.contains_key(&id) { return; } Loading