fold was not using the variable capturing the sequential data; I fixed that

This commit is contained in:
Vladimir Komendantskiy 2018-04-24 11:39:40 +01:00
parent 36cb880186
commit 92d8c0d71a
2 changed files with 2 additions and 7 deletions

View File

@ -284,12 +284,7 @@ impl<'a, HandlerError: AlgoError> MessageLoop<'a, HandlerError> {
} => {
self.remote_txs.iter().fold(result, |result1, (uid, tx)| {
if result1.is_err() { result1 } else {
if let Some(tx) = self.remote_txs.get(&uid) {
tx.send(message.clone()).map_err(Error::from)
}
else {
Err(Error::SendError)
}
tx.send(message.clone()).map_err(Error::from)
}
})
}

View File

@ -68,7 +68,7 @@ impl<'a> TestNode<'a>
pub fn run(&'a self) -> Result<HashSet<ProposedValue>, Error>
{
let node0_uid = "127.0.0.1:0".parse().unwrap();
let node0_uid = node_addr(0);
self.message_loop.insert_algo(Algorithm::Broadcast(node0_uid), self);
Err(Error::NotImplemented)