Commit de460b06 authored by Nick Mathewson's avatar Nick Mathewson 🦀 Committed by Ian Jackson
Browse files

Remove unused DirMgr::netdir method, make opt_netdir private.

parent c39aa5de
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
BREAKING: Changes to error variants.
BREAKING: Renamed DirSkewTolerance to DirTolerance.
BREAKING: Removed `netdir` method from DirMgr, and make `opt_netdir` private.
+1 −11
Original line number Diff line number Diff line
@@ -860,20 +860,10 @@ impl<R: Runtime> DirMgr<R> {
    }

    /// Return an Arc handle to our latest directory, if we have one.
    pub fn opt_netdir(&self) -> Option<Arc<NetDir>> {
    fn opt_netdir(&self) -> Option<Arc<NetDir>> {
        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<Arc<NetDir>> {
        self.opt_netdir().ok_or(Error::DirectoryNotPresent)
    }

    /// Return a new asynchronous stream that will receive notification
    /// whenever the consensus has changed.
    ///