Resolve clippy lints in syn and synom
diff --git a/src/expr.rs b/src/expr.rs
index f717b2b..16f277c 100644
--- a/src/expr.rs
+++ b/src/expr.rs
@@ -1233,7 +1233,7 @@
(ExprGroup {
expr: Box::new(e.0),
group_token: e.1,
- }.into())
+ })
));
}
@@ -1243,7 +1243,7 @@
(ExprParen {
expr: Box::new(e.0),
paren_token: e.1,
- }.into())
+ })
));
}
@@ -1463,7 +1463,7 @@
block: catch_block,
do_token: do_,
catch_token: catch_,
- }.into())
+ })
));
}
@@ -1494,7 +1494,7 @@
map!(punct!(,), Some)
)) >>
comma2: cond!(!arm_expr_requires_comma(&expr), option!(punct!(,))) >>
- (expr, comma1.and_then(|x| x).or(comma2.and_then(|x| x)))
+ (expr, comma1.and_then(|x| x).or_else(|| comma2.and_then(|x| x)))
) >>
(Arm {
rocket_token: rocket,
@@ -1694,7 +1694,7 @@
)
|
map!(syn!(Ident), |name| FieldValue {
- ident: name.clone(),
+ ident: name,
expr: ExprKind::Path(ExprPath { qself: None, path: name.into() }).into(),
is_shorthand: true,
attrs: Vec::new(),
@@ -2046,7 +2046,7 @@
} else {
BindingMode::ByValue(mutability)
},
- ident: ident.clone(),
+ ident: ident,
subpat: None,
at_token: None,
}.into();
@@ -2409,7 +2409,7 @@
if_false: &Option<Box<Expr>>)
{
if let Some(ref if_false) = *if_false {
- TokensOrDefault(&else_token).to_tokens(tokens);
+ TokensOrDefault(else_token).to_tokens(tokens);
// If we are not one of the valid expressions to exist in an else
// clause, wrap ourselves in a block.