Commit e7f2979 1 parent fa46717 commit e7f2979 Copy full SHA for e7f2979
File tree 2 files changed +21
-1
lines changed
2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ fn test_ref_deref() {
39
39
#[ derive( Template ) ]
40
40
#[ template(
41
41
source = r#"
42
- {%- let x = *title -%}
42
+ {%- let x = ** title -%}
43
43
{%- if x == "another" -%}
44
44
another2
45
45
{%- else -%}
Original file line number Diff line number Diff line change @@ -131,3 +131,23 @@ fn test_decl_assign_range() {
131
131
let t = DeclAssignRange ;
132
132
assert_eq ! ( t. render( ) . unwrap( ) , "1" ) ;
133
133
}
134
+
135
+ #[ derive( Template ) ]
136
+ #[ template(
137
+ source = "
138
+ {%- set t = title -%}
139
+ {{t}}/{{title -}}
140
+ " ,
141
+ ext = "txt"
142
+ ) ]
143
+ struct DoNotMoveFields {
144
+ title : String ,
145
+ }
146
+
147
+ #[ test]
148
+ fn test_not_moving_fields_in_var ( ) {
149
+ let x = DoNotMoveFields {
150
+ title : "a" . to_string ( ) ,
151
+ } ;
152
+ assert_eq ! ( x. render( ) . unwrap( ) , "a/a" ) ;
153
+ }
You can’t perform that action at this time.
0 commit comments