From e1745be8028f4122000efb8e67199ac484218a97 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Wed, 8 Feb 2017 09:42:56 +0100 Subject: Assorted cleanups as suggested by clippy --- askama/src/generator.rs | 2 +- askama/src/parser.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/askama/src/generator.rs b/askama/src/generator.rs index 403cd44..e5fc6aa 100644 --- a/askama/src/generator.rs +++ b/askama/src/generator.rs @@ -312,7 +312,7 @@ pub fn generate(ast: &syn::DeriveInput, path: &str, mut nodes: Vec) -> Str let mut gen = Generator::new(); gen.path_based_name(ast, path); - if blocks.len() > 0 { + if !blocks.is_empty() { if let Some(extends) = base { if let Expr::StrLit(base_path) = extends { gen.trait_impl(ast, base_path, &blocks); diff --git a/askama/src/parser.rs b/askama/src/parser.rs index 1ba2174..8d35f31 100644 --- a/askama/src/parser.rs +++ b/askama/src/parser.rs @@ -68,7 +68,7 @@ fn expr_filtered(i: &[u8]) -> IResult<&[u8], Expr> { }, }; } - return IResult::Done(left, expr); + IResult::Done(left, expr) } named!(expr_compare, do_parse!( @@ -159,7 +159,7 @@ named!(parse_template>>, many0!(alt!( block_extends | block_block))); -pub fn parse<'a>(src: &'a str) -> Vec> { +pub fn parse(src: &str) -> Vec { match parse_template(src.as_bytes()) { IResult::Done(_, res) => res, IResult::Error(err) => panic!("problems parsing template source: {}", err), -- cgit