Commit 40e14a18 authored by wesleyac's avatar wesleyac 💬
Browse files

tor-chanmgr: Add doccomments and fix typo.

parent a7391cd5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -322,7 +322,7 @@ impl<R: Runtime> ChanMgr<R> {
        let result = self.mgr.handle_incoming(src, stream).await;

        #[cfg(feature = "metrics")]
        self.mgr.metrics.increment_inbound_channels_build(&result);
        self.mgr.metrics.increment_inbound_channels_built(&result);

        result
    }
+3 −1
Original line number Diff line number Diff line
@@ -210,6 +210,7 @@ pub(crate) struct ChanMgrMetrics {

#[cfg(feature = "metrics")]
impl ChanMgrMetrics {
    /// Create a new instance of [`ChanMgrMetrics`].
    pub(crate) fn new() -> Self {
        ChanMgrMetrics {
            inbound_channels_built_success: metrics::counter!(
@@ -334,7 +335,8 @@ impl ChanMgrMetrics {
        }
    }

    pub(crate) fn increment_inbound_channels_build<R>(&self, result: &Result<R>) {
    /// Increment the correct inbound_channels_built counter for the given result.
    pub(crate) fn increment_inbound_channels_built<R>(&self, result: &Result<R>) {
        match result {
            Ok(_) => self.inbound_channels_built_success.increment(1),
            Err(Error::UnusableTarget(_)) => self