tor-chanmgr: tests: Have unwrap_open return a (mut) reference
This avoids confusing bugs where you try to modify the result and nothing happens!
This commit is contained in:
parent
d95f597323
commit
db4ea619f5
|
@ -70,9 +70,9 @@ impl<C: Clone> ChannelState<C> {
|
|||
/// For testing: either give the Open channel inside this state,
|
||||
/// or panic if there is none.
|
||||
#[cfg(test)]
|
||||
fn unwrap_open(&self) -> C {
|
||||
fn unwrap_open(&mut self) -> &mut C {
|
||||
match self {
|
||||
ChannelState::Open(ent) => ent.clone().channel,
|
||||
ChannelState::Open(ent) => &mut ent.channel,
|
||||
_ => panic!("Not an open channel"),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue