Commit ab74506d authored by Ian Jackson's avatar Ian Jackson
Browse files

Abolish ChanMgr::set_default_transport

The comment says
  // TODO pt-client: It's not clear to me that we really need this method.
and empirically, deleting it, and its callee, is fine.
parent 45529545
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -190,12 +190,6 @@ impl CompoundFactory {
        }
    }

    /// Replace the default factory in this object.
    #[cfg(feature = "experimental-api")]
    pub(crate) fn replace_default_factory(&mut self, factory: Arc<dyn ChannelFactory + 'static>) {
        self.default_factory = factory;
    }

    #[cfg(feature = "pt-client")]
    /// Replace the PtMgr in this object.
    pub(crate) fn replace_ptmgr(&mut self, ptmgr: Arc<dyn AbstractPtMgr + 'static>) {
+0 −13
Original line number Diff line number Diff line
@@ -271,19 +271,6 @@ impl<R: Runtime> ChanMgr<R> {
        Ok(r?)
    }

    /// Replace the channel factory that we use for making regular
    /// channels to the Tor network.
    ///
    /// This method can be used to e.g. tell Arti to use a proxy for
    /// outgoing connections.
    #[cfg(feature = "experimental-api")]
    pub fn set_default_transport(&self, factory: Arc<dyn factory::ChannelFactory + 'static>) {
        // TODO pt-client: Perhaps we actually want to take this as part of the constructor instead?
        // TODO pt-client: It's not clear to me that we really need this method.
        self.mgr
            .with_mut_builder(|f| f.replace_default_factory(factory));
    }

    /// Replace the transport registry with one that may know about
    /// more transports.
    #[cfg(feature = "pt-client")]