summaryrefslogtreecommitdiff
path: root/src/context.rs
diff options
context:
space:
mode:
authorAndre Bogus2017-09-08 23:48:29 +0200
committernanotech2017-09-08 17:02:00 -0600
commit7fe85bcd1ddecf58814e35f02cab8ef652a1e9c2 (patch)
treed9ff2e18bb5fc9aac9a870596f727ffb26248f0b /src/context.rs
parentb3694b66f9302e9d6e540f0ff7941ccda7e0000d (diff)
fixed some clippy warnings
Diffstat (limited to '')
-rw-r--r--src/context.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/context.rs b/src/context.rs
index 9fb3bf4..c2e1913 100644
--- a/src/context.rs
+++ b/src/context.rs
@@ -34,7 +34,7 @@ impl<'i, T> Context<'i, T> {
}
pub fn map<U, F: Fn(&T) -> U>(&self, f: F) -> Context<'i, U> {
- Context(self.0.iter().map(|(k, v)| (k.clone(), v.iter().map(&f).collect())).collect())
+ Context(self.0.iter().map(|(k, v)| (*k, v.iter().map(&f).collect())).collect())
}
}
@@ -43,7 +43,7 @@ impl<'i, T: Clone> Context<'i, T> {
pub fn insert(&self, k: &'i str, v: T) -> Self {
let mut ctx = (*self).clone();
{
- let m = ctx.0.entry(k).or_insert(vec![]);
+ let m = ctx.0.entry(k).or_insert_with(Vec::new);
m.push(v);
}
ctx