From 6bcce1965592f3886abbccd55828a79b419c23ec Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 4 Nov 2022 15:47:08 -0400 Subject: [PATCH] GuardMgr: Remove no-longer-relevant `TODO pt-client` comments Also remove a bunch of now-unnecessary `allow(dead_code)` annotations. --- crates/tor-guardmgr/src/bridge/config.rs | 11 ----------- crates/tor-guardmgr/src/bridge/descs.rs | 1 - crates/tor-guardmgr/src/lib.rs | 5 ----- crates/tor-guardmgr/src/sample.rs | 4 ---- 4 files changed, 21 deletions(-) diff --git a/crates/tor-guardmgr/src/bridge/config.rs b/crates/tor-guardmgr/src/bridge/config.rs index 86ebbc2e9..194c92abe 100644 --- a/crates/tor-guardmgr/src/bridge/config.rs +++ b/crates/tor-guardmgr/src/bridge/config.rs @@ -1,5 +1,4 @@ //! Configuration logic and types for bridges. -#![allow(dead_code)] // TODO pt-client: remove. use std::fmt::{self, Display}; use std::net::SocketAddr; @@ -74,16 +73,6 @@ pub struct BridgeConfig { // and check that the toml looks okay. For discussion see // https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/704/diffs#note_2835271 -// TODO pt-client Additionally, make sure that Bridge can be deserialized from a string, -// when that string is a "bridge" line. - -// TODO pt-client We want a "list of bridges'" configuration type -// -// TODO pt-client we want a "should we use bridges at this moment" -// configuration object. -// -// (These last two might be part of the same configuration type.) - impl HasRelayIds for BridgeConfig { fn identity(&self, key_type: RelayIdType) -> Option> { match key_type { diff --git a/crates/tor-guardmgr/src/bridge/descs.rs b/crates/tor-guardmgr/src/bridge/descs.rs index ce1331d87..a1619f471 100644 --- a/crates/tor-guardmgr/src/bridge/descs.rs +++ b/crates/tor-guardmgr/src/bridge/descs.rs @@ -149,7 +149,6 @@ pub(crate) struct BridgeSet { impl BridgeSet { /// Create a new `BridgeSet` from its configuration. - #[allow(dead_code)] // TODO pt-client remove pub(crate) fn new(config: Arc<[BridgeConfig]>, descs: Option>) -> Self { Self { config_last_changed: SystemTime::now(), // TODO pt-client wrong. diff --git a/crates/tor-guardmgr/src/lib.rs b/crates/tor-guardmgr/src/lib.rs index 245c080a0..87587c08a 100644 --- a/crates/tor-guardmgr/src/lib.rs +++ b/crates/tor-guardmgr/src/lib.rs @@ -291,7 +291,6 @@ struct GuardSets { /// Unrecognized fields, including (possibly) other guard sets. #[serde(flatten)] remaining: HashMap, - // TODO pt-client: There must also be a "bridges" GuardSet instance. } /// The key (filename) we use for storing our persistent guard state in the @@ -1478,7 +1477,6 @@ enum FirstHopInner { Chan(OwnedChanTarget), /// We have enough information to connect to a guards _and_ to build /// multihop circuits through it. - #[allow(dead_code)] // TODO pt-client Circ(OwnedCircTarget), } @@ -1509,9 +1507,6 @@ impl FirstHop { } /// If possible, return a view of this object that can be used to build a circuit. - /// - /// TODO pt-client: This will need to return "Some" only for bridges that have - /// a bridge descriptor. pub fn as_circ_target(&self) -> Option<&OwnedCircTarget> { match &self.inner { FirstHopInner::Chan(_) => None, diff --git a/crates/tor-guardmgr/src/sample.rs b/crates/tor-guardmgr/src/sample.rs index fd06c3aad..d1bcba798 100644 --- a/crates/tor-guardmgr/src/sample.rs +++ b/crates/tor-guardmgr/src/sample.rs @@ -1,9 +1,5 @@ //! Logic for manipulating a sampled set of guards, along with various //! orderings on that sample. -// -// TODO pt-client: We must teach GuardSet to handle bridges. That requires us to: -// - allow use of BridgeList in place of NetDir, possibly via a trait implemented by both. -// - allow Guard to be constructed from a Bridge rather than a Relay mod candidate;