File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -172,10 +172,11 @@ impl<'a> Generator<'a> {
172
172
Source :: Source ( _) => path != & * self . input . path ,
173
173
} ;
174
174
if path_is_valid {
175
- let path = path. to_str ( ) . unwrap ( ) ;
175
+ let canonical_path = path. canonicalize ( ) . unwrap ( ) ;
176
+ let include_path = canonical_path. to_str ( ) . unwrap ( ) ;
176
177
buf. write ( format_args ! (
177
178
"const _: &[rinja::helpers::core::primitive::u8] =\
178
- rinja::helpers::core::include_bytes!({path :#?});",
179
+ rinja::helpers::core::include_bytes!({include_path :#?});",
179
180
) ) ;
180
181
}
181
182
}
Original file line number Diff line number Diff line change @@ -191,9 +191,9 @@ fn check_if_let() {
191
191
192
192
// In this test we make sure that every used template gets referenced exactly once.
193
193
let path = Path :: new ( env ! ( "CARGO_MANIFEST_DIR" ) ) . join ( "templates" ) ;
194
- let path1 = path. join ( "include1.html" ) ;
195
- let path2 = path. join ( "include2.html" ) ;
196
- let path3 = path. join ( "include3.html" ) ;
194
+ let path1 = path. join ( "include1.html" ) . canonicalize ( ) . unwrap ( ) ;
195
+ let path2 = path. join ( "include2.html" ) . canonicalize ( ) . unwrap ( ) ;
196
+ let path3 = path. join ( "include3.html" ) . canonicalize ( ) . unwrap ( ) ;
197
197
compare (
198
198
r#"{% include "include1.html" %}"# ,
199
199
& format ! (
You can’t perform that action at this time.
0 commit comments