Comments to explain effects of return in closure.

This commit is contained in:
Nick Mathewson 2022-10-17 10:51:18 -04:00
parent c802d39b80
commit c0bca7213c
1 changed files with 6 additions and 2 deletions

View File

@ -304,14 +304,18 @@ impl<CF: AbstractChannelFactory> AbstractChanMgr<CF> {
}
None => {
// Something removed our entry from the list.
// Time to retry.
//
// (This return is inside the closure.)
return Err(Error::IdentityConflict);
}
Some(ent @ Open(_)) => {
// Oh no. Something else built an entry
// here, and replaced us. Put that
// something back.
channel_map.insert(ent);
// something back, and retry.
channel_map.insert(ent);
// (This return is inside the closure.)
return Err(Error::IdentityConflict);
}
}