aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--askama/src/generator.rs2
-rw-r--r--askama/src/parser.rs4
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),