diff --git a/syndicate/src/actor.rs b/syndicate/src/actor.rs index f7cd0ab..c289f6a 100644 --- a/syndicate/src/actor.rs +++ b/syndicate/src/actor.rs @@ -30,7 +30,6 @@ use preserves_schema::support::Parse; use preserves_schema::support::Unparse; use std::any::Any; -use std::boxed::Box; use std::collections::hash_map::HashMap; use std::convert::TryFrom; use std::convert::TryInto; @@ -1031,9 +1030,7 @@ impl<'activation> Activation<'activation> { ac(self)? } } - if should_loop { - continue; - } else { + if !should_loop { break; } } @@ -1617,8 +1614,8 @@ impl EventBuffer { let mut table = HashMap::new(); table.insert(aid, (tx, q)); self.multiple_queues = Some(table); - return &mut self.multiple_queues.as_mut().unwrap().entry(mailbox.actor_id) - .or_insert((mailbox.tx.clone(), Vec::with_capacity(3))).1; + &mut self.multiple_queues.as_mut().unwrap().entry(mailbox.actor_id) + .or_insert((mailbox.tx.clone(), Vec::with_capacity(3))).1 } fn commit(&mut self) { @@ -1778,13 +1775,13 @@ impl PartialEq for Mailbox { impl Ord for Mailbox { fn cmp(&self, other: &Mailbox) -> std::cmp::Ordering { - return self.actor_id.cmp(&other.actor_id) + self.actor_id.cmp(&other.actor_id) } } impl PartialOrd for Mailbox { fn partial_cmp(&self, other: &Mailbox) -> Option { - return Some(self.cmp(&other)) + Some(self.cmp(&other)) } } diff --git a/syndicate/src/bag.rs b/syndicate/src/bag.rs index bf71301..566c795 100644 --- a/syndicate/src/bag.rs +++ b/syndicate/src/bag.rs @@ -4,7 +4,7 @@ use std::collections::BTreeMap; use std::collections::btree_map::{Iter, Keys, Entry}; -use std::iter::{FromIterator, IntoIterator}; +use std::iter::FromIterator; /// Element counts in [`BTreeBag`]s are 32-bit signed integers. pub type Count = i32; diff --git a/syndicate/src/dataspace.rs b/syndicate/src/dataspace.rs index cec9036..2f27849 100644 --- a/syndicate/src/dataspace.rs +++ b/syndicate/src/dataspace.rs @@ -12,7 +12,6 @@ use super::language; use super::skeleton; use super::actor::*; use super::schemas::dataspace::*; -use super::schemas::dataspace::_Any; use preserves::value::Map; use preserves_schema::Codec; diff --git a/syndicate/src/relay.rs b/syndicate/src/relay.rs index 9c75f65..ebaa7fb 100644 --- a/syndicate/src/relay.rs +++ b/syndicate/src/relay.rs @@ -685,12 +685,12 @@ async fn input_loop( buf.reserve(BUFSIZE); let n = match r.read_buf(&mut buf).await { Ok(n) => n, - Err(e) => + Err(e) => { if e.kind() == io::ErrorKind::ConnectionReset { break; - } else { - return Err(e)?; - }, + } + return Err(e)?; + } }; match n { 0 => break,