From bb7c60ece5dcfea9d31f79f445f80fdd4e0bf3ca Mon Sep 17 00:00:00 2001 From: René Kijewski Date: Wed, 12 Jan 2022 14:25:58 +0100 Subject: Replace `&PathBuf` with `&Path` PathBuf is to String like Path is to str, so `&PathBuf` is a pointer to a pointer. Clippy does not likes that. --- askama_derive/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'askama_derive') diff --git a/askama_derive/src/lib.rs b/askama_derive/src/lib.rs index 4e2a3af..cc50ac8 100644 --- a/askama_derive/src/lib.rs +++ b/askama_derive/src/lib.rs @@ -46,7 +46,7 @@ fn build_template(ast: &syn::DeriveInput) -> Result { let mut parsed = HashMap::new(); for (path, src) in &sources { - parsed.insert(path, parse(src, input.syntax)?); + parsed.insert(path.as_path(), parse(src, input.syntax)?); } let mut contexts = HashMap::new(); @@ -54,7 +54,7 @@ fn build_template(ast: &syn::DeriveInput) -> Result { contexts.insert(*path, Context::new(input.config, path, nodes)?); } - let ctx = &contexts[&input.path]; + let ctx = &contexts[input.path.as_path()]; let heritage = if !ctx.blocks.is_empty() || ctx.extends.is_some() { Some(Heritage::new(ctx, &contexts)) } else { @@ -62,7 +62,7 @@ fn build_template(ast: &syn::DeriveInput) -> Result { }; if input.print == Print::Ast || input.print == Print::All { - eprintln!("{:?}", parsed[&input.path]); + eprintln!("{:?}", parsed[input.path.as_path()]); } let code = generator::generate(&input, &contexts, heritage.as_ref(), INTEGRATIONS)?; -- cgit