diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-08-06 14:56:09 +0200 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-08-06 14:56:09 +0200 |
commit | 077c56c00782ff826e46258f678ef0f163f4e3cb (patch) | |
tree | 8bcbb6aa2e835cc742cf19de5e39280b5aa0e326 /askama_derive/src/path.rs | |
parent | b9cb5b82e6c87bf0f6037d097476d69f5241bf3a (diff) | |
download | askama-077c56c00782ff826e46258f678ef0f163f4e3cb.tar.gz askama-077c56c00782ff826e46258f678ef0f163f4e3cb.tar.bz2 askama-077c56c00782ff826e46258f678ef0f163f4e3cb.zip |
Use one way of finding templates on the path
Diffstat (limited to 'askama_derive/src/path.rs')
-rw-r--r-- | askama_derive/src/path.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/askama_derive/src/path.rs b/askama_derive/src/path.rs index 28b1b17..b51f5f3 100644 --- a/askama_derive/src/path.rs +++ b/askama_derive/src/path.rs @@ -33,9 +33,9 @@ pub fn find_template_from_path<'a>(path: &str, start_at: Option<&str>) -> PathBu } } -pub fn get_template_source(tpl_file: &str) -> String { +pub fn get_template_source(tpl_path: &Path) -> String { let mut path = template_dir(); - path.push(Path::new(tpl_file)); + path.push(tpl_path); let mut f = match File::open(&path) { Err(_) => { let msg = format!("unable to open template file '{}'", @@ -59,7 +59,7 @@ mod tests { #[test] fn get_source() { - assert_eq!(get_template_source("sub/b.html"), "bar"); + assert_eq!(get_template_source(Path::new("sub/b.html")), "bar"); } #[test] |