From a981afc465f4279a7a4d6ce3ac5844e04846613b Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Tue, 27 Aug 2019 22:58:20 +0200 Subject: clippy --- dhall_syntax/src/core/expr.rs | 2 +- dhall_syntax/src/core/import.rs | 2 +- dhall_syntax/src/parser.rs | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'dhall_syntax') diff --git a/dhall_syntax/src/core/expr.rs b/dhall_syntax/src/core/expr.rs index efbcee2..32166a6 100644 --- a/dhall_syntax/src/core/expr.rs +++ b/dhall_syntax/src/core/expr.rs @@ -331,7 +331,7 @@ impl Expr { ExprF::BinOp(BinOp::ImportAlt, l, r) => l .as_ref() .traverse_resolve_with_visitor(visitor) - .or(r.as_ref().traverse_resolve_with_visitor(visitor)), + .or_else(|_| r.as_ref().traverse_resolve_with_visitor(visitor)), _ => { let e = self.visit(&mut *visitor)?; Ok(match &e { diff --git a/dhall_syntax/src/core/import.rs b/dhall_syntax/src/core/import.rs index 9329d48..d1f3fca 100644 --- a/dhall_syntax/src/core/import.rs +++ b/dhall_syntax/src/core/import.rs @@ -79,7 +79,7 @@ impl ImportLocation { ) -> Result, Err> { use ImportLocation::*; Ok(match self { - Local(prefix, path) => Local(prefix.clone(), path.clone()), + Local(prefix, path) => Local(*prefix, path.clone()), Remote(url) => Remote(url.visit_subexpr(f)?), Env(env) => Env(env.clone()), Missing => Missing, diff --git a/dhall_syntax/src/parser.rs b/dhall_syntax/src/parser.rs index 4da1dfc..d631a19 100644 --- a/dhall_syntax/src/parser.rs +++ b/dhall_syntax/src/parser.rs @@ -349,7 +349,7 @@ macro_rules! make_parser { impl Parsers { $( - #[allow(non_snake_case, unused_variables)] + #[allow(non_snake_case, unused_variables, clippy::let_unit_value)] fn $name<'a>( (climbers, input): (&HashMap>, Rc), pair: Pair<'a, Rule>, @@ -508,7 +508,7 @@ make_parser! { 0xAFFFE..=0xAFFFF | 0xBFFFE..=0xBFFFF | 0xCFFFE..=0xCFFFF | 0xDFFFE..=0xDFFFF | 0xEFFFE..=0xEFFFF | 0xFFFFE..=0xFFFFF | - 0x10FFFE..=0x10FFFF => { + 0x10_FFFE..=0x10_FFFF => { let c_ecapsed = c.escape_unicode(); Err(format!("Escape sequences can't contain non-characters: \"{}\"", c_ecapsed))? }, @@ -1064,7 +1064,7 @@ make_parser! { )); rule!(final_expression; children!( - [expression(e), EOI(_eoi)] => e + [expression(e), EOI(_)] => e )); } -- cgit v1.2.3