Commit 55ef6972 authored by Nick Mathewson's avatar Nick Mathewson 🤹
Browse files

Remove #![allow_unused] in tor_chanmgr::mgr

parent 7159941a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
//! Abstract implementation of a channel manager

#![allow(dead_code)]
use crate::err::PendingChanError;
use crate::{Error, Result};

@@ -85,6 +84,7 @@ impl<CF: ChannelFactory> AbstractChanMgr<CF> {
    }

    /// Remove every unusable entry from this channel manager.
    #[cfg(test)]
    pub(crate) fn remove_unusable_entries(&self) -> Result<()> {
        self.channels.remove_unusable()
    }
+3 −0
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ pub(crate) enum ChannelState<C> {

impl<C> ChannelState<C> {
    /// Create a new shallow copy of this ChannelState.
    #[cfg(test)]
    fn clone_ref(&self) -> Result<Self> {
        use ChannelState::*;
        match self {
@@ -93,6 +94,7 @@ impl<C: AbstractChannel> ChannelMap<C> {
    }

    /// Return the channel state for the given identity, if any.
    #[cfg(test)]
    pub(crate) fn get(&self, ident: &C::Ident) -> Result<Option<ChannelState<C>>> {
        let map = self.channels.lock()?;
        map.get(ident).map(ChannelState::clone_ref).transpose()
@@ -117,6 +119,7 @@ impl<C: AbstractChannel> ChannelMap<C> {
    }

    /// Remove every unusable state from the map.
    #[cfg(test)]
    pub(crate) fn remove_unusable(&self) -> Result<()> {
        let mut map = self.channels.lock()?;
        map.retain(|_, state| match state {