mirror of
https://github.com/askama-rs/askama.git
synced 2025-10-01 06:51:15 +00:00
Assorted cleanups as suggested by clippy
This commit is contained in:
parent
d58ade7c8d
commit
e1745be802
@ -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);
|
||||
|
@ -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),
|
||||
|
Loading…
x
Reference in New Issue
Block a user