diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-02-08 09:42:56 +0100 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-02-08 09:42:56 +0100 |
commit | e1745be8028f4122000efb8e67199ac484218a97 (patch) | |
tree | 402aaf48d7d8e5235f21cc6679e7caa5d54ddce0 | |
parent | d58ade7c8d5f6db78b3f3db0591aed0199ce8940 (diff) | |
download | askama-e1745be8028f4122000efb8e67199ac484218a97.tar.gz askama-e1745be8028f4122000efb8e67199ac484218a97.tar.bz2 askama-e1745be8028f4122000efb8e67199ac484218a97.zip |
Assorted cleanups as suggested by clippy
Diffstat (limited to '')
-rw-r--r-- | askama/src/generator.rs | 2 | ||||
-rw-r--r-- | 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<Node>) -> 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<Expr>, do_parse!( @@ -159,7 +159,7 @@ named!(parse_template<Vec<Node<'a>>>, many0!(alt!( block_extends | block_block))); -pub fn parse<'a>(src: &'a str) -> Vec<Node<'a>> { +pub fn parse(src: &str) -> Vec<Node> { match parse_template(src.as_bytes()) { IResult::Done(_, res) => res, IResult::Error(err) => panic!("problems parsing template source: {}", err), |