aboutsummaryrefslogtreecommitdiffstats
path: root/askama_derive
diff options
context:
space:
mode:
authorLibravatar René Kijewski <kijewski@library.vetmed.fu-berlin.de>2022-01-12 14:25:58 +0100
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2022-01-24 13:28:53 +0100
commitbb7c60ece5dcfea9d31f79f445f80fdd4e0bf3ca (patch)
treed687cb8ba6c0d8fcaecfc97076fa24df887dac59 /askama_derive
parent86fd2f4f8b1e32803fd7acc43e98dbbb137156b5 (diff)
downloadaskama-bb7c60ece5dcfea9d31f79f445f80fdd4e0bf3ca.tar.gz
askama-bb7c60ece5dcfea9d31f79f445f80fdd4e0bf3ca.tar.bz2
askama-bb7c60ece5dcfea9d31f79f445f80fdd4e0bf3ca.zip
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.
Diffstat (limited to 'askama_derive')
-rw-r--r--askama_derive/src/lib.rs6
1 files changed, 3 insertions, 3 deletions
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<String, CompileError> {
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<String, CompileError> {
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<String, CompileError> {
};
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)?;