diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2023-10-06 11:53:05 +0200 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2023-11-01 12:52:09 +0100 |
commit | a057f81c051ae71329c5377b0351e6a09231c30d (patch) | |
tree | 4aac6fe8ab5be5f78f2d9a65c67aac450052d3e4 /askama_derive/src/input.rs | |
parent | 4de28e4584727d4df1cef1c8844db864df128995 (diff) | |
download | askama-a057f81c051ae71329c5377b0351e6a09231c30d.tar.gz askama-a057f81c051ae71329c5377b0351e6a09231c30d.tar.bz2 askama-a057f81c051ae71329c5377b0351e6a09231c30d.zip |
Inline some logic into find_used_templates()
Diffstat (limited to '')
-rw-r--r-- | askama_derive/src/input.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/askama_derive/src/input.rs b/askama_derive/src/input.rs index 03817f1..891dec7 100644 --- a/askama_derive/src/input.rs +++ b/askama_derive/src/input.rs @@ -104,8 +104,12 @@ impl TemplateInput<'_> { pub(crate) fn find_used_templates( &self, map: &mut HashMap<PathBuf, Parsed>, - source: String, ) -> Result<(), CompileError> { + let source = match &self.source { + Source::Source(s) => s.clone(), + Source::Path(_) => get_template_source(&self.path)?, + }; + let mut dependency_graph = Vec::new(); let mut check = vec![(self.path.clone(), source)]; while let Some((path, source)) = check.pop() { |