@@ -6,17 +6,17 @@ use std::path::Path;
6
6
use std:: rc:: Rc ;
7
7
use std:: { cmp, hash, mem, str} ;
8
8
9
- use crate :: config:: WhitespaceHandling ;
10
- use crate :: heritage:: { Context , Heritage } ;
11
- use crate :: input:: { Source , TemplateInput } ;
12
- use crate :: { CompileError , CRATE } ;
13
-
14
9
use parser:: node:: {
15
10
Call , Comment , CondTest , FilterBlock , If , Include , Let , Lit , Loop , Match , Whitespace , Ws ,
16
11
} ;
17
12
use parser:: { Expr , Filter , Node , Target , WithSpan } ;
18
13
use quote:: quote;
19
14
15
+ use crate :: config:: WhitespaceHandling ;
16
+ use crate :: heritage:: { Context , Heritage } ;
17
+ use crate :: input:: { Source , TemplateInput } ;
18
+ use crate :: { CompileError , CRATE } ;
19
+
20
20
pub ( crate ) struct Generator < ' a > {
21
21
// The template input state: original struct AST and attributes
22
22
input : & ' a TemplateInput < ' a > ,
@@ -240,7 +240,7 @@ impl<'a> Generator<'a> {
240
240
) ) ;
241
241
}
242
242
243
- /* Helper methods for handling node types */
243
+ // Helper methods for handling node types
244
244
245
245
fn handle (
246
246
& mut self ,
@@ -960,7 +960,7 @@ impl<'a> Generator<'a> {
960
960
( None , Some ( ( prev_name, gen) ) ) => ( prev_name, gen + 1 ) ,
961
961
// `super()` is called from outside a block
962
962
( None , None ) => {
963
- return Err ( ctx. generate_error ( "cannot call 'super()' outside block" , node) )
963
+ return Err ( ctx. generate_error ( "cannot call 'super()' outside block" , node) ) ;
964
964
}
965
965
} ;
966
966
@@ -1225,7 +1225,7 @@ impl<'a> Generator<'a> {
1225
1225
self . handle_ws ( comment. ws ) ;
1226
1226
}
1227
1227
1228
- /* Visitor methods for expression types */
1228
+ // Visitor methods for expression types
1229
1229
1230
1230
fn visit_expr_root (
1231
1231
& mut self ,
@@ -1415,7 +1415,7 @@ impl<'a> Generator<'a> {
1415
1415
let opt_escaper = match args. get ( 1 ) . map ( |expr| & * * expr) {
1416
1416
Some ( Expr :: StrLit ( name) ) => Some ( * name) ,
1417
1417
Some ( _) => {
1418
- return Err ( ctx. generate_error ( "invalid escaper type for escape filter" , node) )
1418
+ return Err ( ctx. generate_error ( "invalid escaper type for escape filter" , node) ) ;
1419
1419
}
1420
1420
None => None ,
1421
1421
} ;
@@ -1618,7 +1618,7 @@ impl<'a> Generator<'a> {
1618
1618
_ => {
1619
1619
return Err (
1620
1620
ctx. generate_error ( "loop.cycle(…) cannot use an empty array" , left)
1621
- )
1621
+ ) ;
1622
1622
}
1623
1623
} ,
1624
1624
s => return Err ( ctx. generate_error ( & format ! ( "unknown loop method: {s:?}" ) , left) ) ,
@@ -1873,7 +1873,7 @@ impl<'a> Generator<'a> {
1873
1873
}
1874
1874
}
1875
1875
1876
- /* Helper methods for dealing with whitespace nodes */
1876
+ // Helper methods for dealing with whitespace nodes
1877
1877
1878
1878
// Combines `flush_ws()` and `prepare_ws()` to handle both trailing whitespace from the
1879
1879
// preceding literal and leading whitespace from the succeeding literal.
0 commit comments