From 47c0a3ca296a9b775275c2c7118a172b9f0bcc54 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Mon, 8 Apr 2019 18:23:55 +0200 Subject: clippy --- dhall_core/src/core.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'dhall_core/src/core.rs') diff --git a/dhall_core/src/core.rs b/dhall_core/src/core.rs index 89506ec..39dea37 100644 --- a/dhall_core/src/core.rs +++ b/dhall_core/src/core.rs @@ -25,7 +25,7 @@ pub struct NaiveDouble(f64); impl PartialEq for NaiveDouble { fn eq(&self, other: &Self) -> bool { - return self.0.to_bits() == other.0.to_bits(); + self.0.to_bits() == other.0.to_bits() } } @@ -283,7 +283,7 @@ impl Expr { F: Fn(&A) -> B, { let recurse = |e: &Expr| -> Expr { e.map_embed(map_embed) }; - self.map_shallow(recurse, |x| x.clone(), map_embed, |x| x.clone()) + self.map_shallow(recurse, S::clone, map_embed, Label::clone) } #[inline(always)] @@ -315,7 +315,7 @@ impl Expr { F: Fn(&Label) -> Label, { let recurse = |e: &Self| -> Self { e.map_label(map_label) }; - self.map_shallow(recurse, |x| x.clone(), |x| x.clone(), map_label) + self.map_shallow(recurse, S::clone, A::clone, map_label) } #[inline(always)] @@ -333,10 +333,10 @@ impl Expr> { match self { ExprF::Embed(e) => e.clone(), e => e.map_shallow( - |e| e.squash_embed(), - |x| x.clone(), + >>::squash_embed, + S::clone, |_| unreachable!(), - |x| x.clone(), + Label::clone, ), } } @@ -368,7 +368,7 @@ impl ExprF { fn opt(x: &Option) -> Option<&T> { x.as_ref() } - fn vec(x: &Vec) -> Vec<&T> { + fn vec(x: &[T]) -> Vec<&T> { x.iter().collect() } fn btmap(x: &BTreeMap) -> BTreeMap<&L, &SE> { -- cgit v1.2.3