aboutsummaryrefslogtreecommitdiffstats
path: root/askama_derive/src/input.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--askama_derive/src/input.rs6
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() {