Add clippy lints, action some clippy items

This commit is contained in:
Jeremy Soller
2017-12-24 22:19:00 -07:00
parent e08f56a2de
commit 58e1d92eb5
37 changed files with 586 additions and 231 deletions

View File

@@ -31,7 +31,7 @@ impl WaitCondition {
let context_lock = {
let contexts = context::contexts();
let context_lock = contexts.current().expect("WaitCondition::wait: no context");
context_lock.clone()
Arc::clone(&context_lock)
};
{

View File

@@ -33,7 +33,7 @@ impl<K, V> WaitMap<K, V> where K: Clone + Ord {
pub fn receive_any_nonblock(&self) -> Option<(K, V)> {
let mut inner = self.inner.lock();
if let Some(key) = inner.keys().next().map(|key| key.clone()) {
if let Some(key) = inner.keys().next().cloned() {
inner.remove(&key).map(|value| (key, value))
} else {
None