From 1521f63bf1ebd3708bda74476b1b8a8ac2d67f4c Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 30 Nov 2022 16:40:45 +0000 Subject: [PATCH 1/3] ptmgr todo: Tolerate exposing the Vec for now We may want to change this later, but this API is in a low level crate, so this isn't a blocker. --- crates/tor-ptmgr/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/tor-ptmgr/src/lib.rs b/crates/tor-ptmgr/src/lib.rs index a40c3fbab..bfe5391f1 100644 --- a/crates/tor-ptmgr/src/lib.rs +++ b/crates/tor-ptmgr/src/lib.rs @@ -319,7 +319,7 @@ impl PtMgr { } /// Create a new PtMgr. - // TODO pt-client: maybe don't have the Vec directly exposed? + // TODO: maybe don't have the Vec directly exposed? pub fn new( transports: Vec, state_dir: PathBuf, From fe331129239e203169fa32768d2e98049df78d66 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 30 Nov 2022 16:42:18 +0000 Subject: [PATCH 2/3] ptmgr: No need for state_dir in PtMgr This is used exclusively by the reactor. --- crates/tor-ptmgr/src/lib.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/crates/tor-ptmgr/src/lib.rs b/crates/tor-ptmgr/src/lib.rs index bfe5391f1..4d401a8c5 100644 --- a/crates/tor-ptmgr/src/lib.rs +++ b/crates/tor-ptmgr/src/lib.rs @@ -296,8 +296,6 @@ pub struct PtMgr { state: Arc>, /// PtReactor channel. tx: UnboundedSender, - /// Directory to store PT state in. - state_dir: PathBuf, } impl PtMgr { @@ -332,7 +330,7 @@ impl PtMgr { let state = Arc::new(RwLock::new(state)); let (tx, rx) = mpsc::unbounded(); - let mut reactor = PtReactor::new(rt.clone(), state.clone(), rx, state_dir.clone()); + let mut reactor = PtReactor::new(rt.clone(), state.clone(), rx, state_dir); rt.spawn(async move { loop { match reactor.run_one_step().await { @@ -351,7 +349,6 @@ impl PtMgr { runtime: rt, state, tx, - state_dir, }) } From fa676ce577d48871bcc1cfec4328ce9b6e14b4d3 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 30 Nov 2022 16:42:40 +0000 Subject: [PATCH 3/3] ptmgr todo: Remove dead code allow --- crates/tor-ptmgr/src/lib.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/crates/tor-ptmgr/src/lib.rs b/crates/tor-ptmgr/src/lib.rs index 4d401a8c5..6741dcfe0 100644 --- a/crates/tor-ptmgr/src/lib.rs +++ b/crates/tor-ptmgr/src/lib.rs @@ -37,8 +37,6 @@ #![allow(clippy::result_large_err)] // temporary workaround for arti#587 //! -#![allow(dead_code)] // FIXME TODO pt-client remove after implementing reactor. - pub mod config; pub mod err; pub mod ipc;