Remove #![allow_unused] in tor_chanmgr::mgr
This commit is contained in:
parent
7159941ae1
commit
55ef69724c
|
@ -1,6 +1,5 @@
|
|||
//! 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()
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue