From de460b066830a2749ecbca3f097740864252463d Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Mon, 25 Jul 2022 11:06:35 -0400 Subject: [PATCH] Remove unused DirMgr::netdir method, make opt_netdir private. --- crates/tor-dirmgr/semver.md | 1 + crates/tor-dirmgr/src/lib.rs | 12 +----------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/crates/tor-dirmgr/semver.md b/crates/tor-dirmgr/semver.md index 4dd29e682..91c13a82d 100644 --- a/crates/tor-dirmgr/semver.md +++ b/crates/tor-dirmgr/semver.md @@ -1,2 +1,3 @@ BREAKING: Changes to error variants. BREAKING: Renamed DirSkewTolerance to DirTolerance. +BREAKING: Removed `netdir` method from DirMgr, and make `opt_netdir` private. diff --git a/crates/tor-dirmgr/src/lib.rs b/crates/tor-dirmgr/src/lib.rs index 17b30bd85..2d9657e81 100644 --- a/crates/tor-dirmgr/src/lib.rs +++ b/crates/tor-dirmgr/src/lib.rs @@ -860,20 +860,10 @@ impl DirMgr { } /// Return an Arc handle to our latest directory, if we have one. - pub fn opt_netdir(&self) -> Option> { + fn opt_netdir(&self) -> Option> { self.netdir.get() } - /// Return an Arc handle to our latest directory, returning an error if there is none. - /// - /// # Errors - /// - /// Errors with [`Error::DirectoryNotPresent`] if the `DirMgr` hasn't been bootstrapped yet. - // TODO: Add variants of this that make sure that it's up-to-date? - pub fn netdir(&self) -> Result> { - self.opt_netdir().ok_or(Error::DirectoryNotPresent) - } - /// Return a new asynchronous stream that will receive notification /// whenever the consensus has changed. ///