From eff10b74567881eef73868f3e3391c6a0e922375 Mon Sep 17 00:00:00 2001 From: René Kijewski Date: Fri, 7 Jan 2022 01:06:14 +0100 Subject: Unshadow function escaping() --- askama_shared/src/input.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'askama_shared/src/input.rs') diff --git a/askama_shared/src/input.rs b/askama_shared/src/input.rs index 7d28a7e..25d61e1 100644 --- a/askama_shared/src/input.rs +++ b/askama_shared/src/input.rs @@ -161,7 +161,7 @@ impl TemplateInput<'_> { // Match extension against defined output formats - let extension = escaping.unwrap_or_else(|| { + let escaping = escaping.unwrap_or_else(|| { path.extension() .map(|s| s.to_str().unwrap()) .unwrap_or("") @@ -170,14 +170,14 @@ impl TemplateInput<'_> { let mut escaper = None; for (extensions, path) in &config.escapers { - if extensions.contains(&extension) { + if extensions.contains(&escaping) { escaper = Some(path); break; } } let escaper = escaper.ok_or_else(|| { - CompileError::String(format!("no escaper defined for extension '{}'", extension,)) + CompileError::String(format!("no escaper defined for extension '{}'", escaping,)) })?; Ok(TemplateInput { -- cgit