@@ -86,7 +86,7 @@ impl<'a> Node<'a> {
86
86
fn parse ( i : & mut & ' a str , s : & State < ' _ , ' _ > ) -> ParseResult < ' a , Self > {
87
87
let mut start = * i;
88
88
let tag = preceded (
89
- | i : & mut _ | s. tag_block_start ( i ) ,
89
+ s. tag_block_start ( ) ,
90
90
peek ( preceded ( ( opt ( Whitespace :: parse) , skip_ws0) , identifier) ) ,
91
91
)
92
92
. parse_next ( i) ?;
@@ -113,10 +113,7 @@ impl<'a> Node<'a> {
113
113
let node = func ( i, s) ?;
114
114
let closed = cut_node (
115
115
None ,
116
- alt ( (
117
- ws ( eof) . value ( false ) ,
118
- ( |i : & mut _ | s. tag_block_end ( i) ) . value ( true ) ,
119
- ) ) ,
116
+ alt ( ( ws ( eof) . value ( false ) , s. tag_block_end ( ) . value ( true ) ) ) ,
120
117
)
121
118
. parse_next ( i) ?;
122
119
match closed {
@@ -238,7 +235,7 @@ fn cut_node<'a, O>(
238
235
239
236
fn unexpected_tag < ' a > ( i : & mut & ' a str , s : & State < ' _ , ' _ > ) -> ParseResult < ' a , ( ) > {
240
237
(
241
- | i : & mut _ | s. tag_block_start ( i ) ,
238
+ s. tag_block_start ( ) ,
242
239
opt ( Whitespace :: parse) ,
243
240
unexpected_raw_tag. bind ( None ) ,
244
241
)
@@ -271,14 +268,14 @@ pub struct When<'a> {
271
268
impl < ' a > When < ' a > {
272
269
fn r#else ( i : & mut & ' a str , s : & State < ' _ , ' _ > ) -> ParseResult < ' a , WithSpan < ' a , Self > > {
273
270
let mut p = (
274
- | i : & mut _ | s. tag_block_start ( i ) ,
271
+ s. tag_block_start ( ) ,
275
272
opt ( Whitespace :: parse) ,
276
273
ws ( keyword ( "else" ) ) ,
277
274
cut_node (
278
275
Some ( "match-else" ) ,
279
276
(
280
277
opt ( Whitespace :: parse) ,
281
- | i : & mut _ | s. tag_block_end ( i ) ,
278
+ s. tag_block_end ( ) ,
282
279
cut_node ( Some ( "match-else" ) , Node :: many. bind ( s) ) ,
283
280
) ,
284
281
) ,
@@ -301,15 +298,15 @@ impl<'a> When<'a> {
301
298
let start = * i;
302
299
let endwhen = ws ( (
303
300
delimited (
304
- | i : & mut _ | s. tag_block_start ( i ) ,
301
+ s. tag_block_start ( ) ,
305
302
opt ( Whitespace :: parse) ,
306
303
ws ( keyword ( "endwhen" ) ) ,
307
304
) ,
308
305
cut_node (
309
306
Some ( "match-endwhen" ) ,
310
307
(
311
308
opt ( Whitespace :: parse) ,
312
- | i : & mut _ | s. tag_block_end ( i ) ,
309
+ s. tag_block_end ( ) ,
313
310
repeat ( 0 .., ws ( Comment :: parse. bind ( s) ) ) . map ( |( ) | ( ) ) ,
314
311
) ,
315
312
) ,
@@ -329,15 +326,15 @@ impl<'a> When<'a> {
329
326
) )
330
327
} ) ;
331
328
let mut p = (
332
- | i : & mut _ | s. tag_block_start ( i ) ,
329
+ s. tag_block_start ( ) ,
333
330
opt ( Whitespace :: parse) ,
334
331
ws ( keyword ( "when" ) ) ,
335
332
cut_node (
336
333
Some ( "match-when" ) ,
337
334
(
338
335
separated ( 1 .., ws ( Target :: parse. bind ( s) ) , '|' ) ,
339
336
opt ( Whitespace :: parse) ,
340
- | i : & mut _ | s. tag_block_end ( i ) ,
337
+ s. tag_block_end ( ) ,
341
338
cut_node ( Some ( "match-when" ) , Node :: many. bind ( s) ) ,
342
339
opt ( endwhen) ,
343
340
) ,
@@ -369,7 +366,7 @@ impl<'a> Cond<'a> {
369
366
fn parse ( i : & mut & ' a str , s : & State < ' _ , ' _ > ) -> ParseResult < ' a , WithSpan < ' a , Self > > {
370
367
let start = * i;
371
368
let ( _, pws, cond, nws, _, nodes) = (
372
- | i : & mut _ | s. tag_block_start ( i ) ,
369
+ s. tag_block_start ( ) ,
373
370
opt ( Whitespace :: parse) ,
374
371
alt ( (
375
372
preceded ( ws ( keyword ( "else" ) ) , opt ( CondTest :: parse. bind ( s) ) ) ,
@@ -379,7 +376,7 @@ impl<'a> Cond<'a> {
379
376
) ,
380
377
) ) ,
381
378
opt ( Whitespace :: parse) ,
382
- cut_node ( Some ( "if" ) , | i : & mut _ | s. tag_block_end ( i ) ) ,
379
+ cut_node ( Some ( "if" ) , s. tag_block_end ( ) ) ,
383
380
cut_node ( Some ( "if" ) , Node :: many. bind ( s) ) ,
384
381
)
385
382
. parse_next ( i) ?;
@@ -492,7 +489,7 @@ fn check_block_start<'a>(
492
489
start,
493
490
) ) ) ;
494
491
}
495
- ( | i : & mut _ | s. tag_block_start ( i ) ) . parse_next ( i)
492
+ s. tag_block_start ( ) . parse_next ( i)
496
493
}
497
494
498
495
#[ derive( Debug , PartialEq ) ]
@@ -529,11 +526,7 @@ impl<'a> Loop<'a> {
529
526
Some ( "for-else" ) ,
530
527
(
531
528
opt ( Whitespace :: parse) ,
532
- delimited (
533
- |i : & mut _ | s. tag_block_end ( i) ,
534
- Node :: many. bind ( s) ,
535
- |i : & mut _ | s. tag_block_start ( i) ,
536
- ) ,
529
+ delimited ( s. tag_block_end ( ) , Node :: many. bind ( s) , s. tag_block_start ( ) ) ,
537
530
opt ( Whitespace :: parse) ,
538
531
) ,
539
532
) ,
@@ -577,7 +570,7 @@ impl<'a> Loop<'a> {
577
570
ws ( Expr :: parse. bind ( s. level , true ) ) ,
578
571
opt ( if_cond) ,
579
572
opt ( Whitespace :: parse) ,
580
- | i : & mut _ | s. tag_block_end ( i ) ,
573
+ s. tag_block_end ( ) ,
581
574
body_and_end,
582
575
) ,
583
576
) ,
@@ -670,7 +663,7 @@ impl<'a> Macro<'a> {
670
663
ws ( identifier) ,
671
664
parameters,
672
665
opt ( Whitespace :: parse) ,
673
- | i : & mut _ | s. tag_block_end ( i ) ,
666
+ s. tag_block_end ( ) ,
674
667
) ,
675
668
) ,
676
669
) ;
@@ -771,7 +764,7 @@ impl<'a> FilterBlock<'a> {
771
764
. map ( |v : Vec < _ > | v) ,
772
765
ws ( empty) ,
773
766
opt ( Whitespace :: parse) ,
774
- | i : & mut _ | s. tag_block_end ( i ) ,
767
+ s. tag_block_end ( ) ,
775
768
) ,
776
769
) ,
777
770
) ;
@@ -915,7 +908,7 @@ impl<'a> Match<'a> {
915
908
(
916
909
ws ( Expr :: parse. bind ( s. level , false ) ) ,
917
910
opt ( Whitespace :: parse) ,
918
- | i : & mut _ | s. tag_block_end ( i ) ,
911
+ s. tag_block_end ( ) ,
919
912
cut_node (
920
913
Some ( "match" ) ,
921
914
(
@@ -984,9 +977,7 @@ impl<'a> BlockDef<'a> {
984
977
ws ( keyword ( "block" ) ) ,
985
978
cut_node (
986
979
Some ( "block" ) ,
987
- ( ws ( identifier) , opt ( Whitespace :: parse) , |i : & mut _ | {
988
- s. tag_block_end ( i)
989
- } ) ,
980
+ ( ws ( identifier) , opt ( Whitespace :: parse) , s. tag_block_end ( ) ) ,
990
981
) ,
991
982
) ;
992
983
let ( pws1, _, ( name, nws1, _) ) = start. parse_next ( i) ?;
@@ -1107,11 +1098,11 @@ impl<'a> Raw<'a> {
1107
1098
fn parse ( i : & mut & ' a str , s : & State < ' _ , ' _ > ) -> ParseResult < ' a , WithSpan < ' a , Self > > {
1108
1099
let start = * i;
1109
1100
let endraw = (
1110
- | i : & mut _ | s. tag_block_start ( i ) ,
1101
+ s. tag_block_start ( ) ,
1111
1102
opt ( Whitespace :: parse) ,
1112
1103
ws ( keyword ( "endraw" ) ) , // sic: ignore `{% end %}` in raw blocks
1113
1104
opt ( Whitespace :: parse) ,
1114
- peek ( | i : & mut _ | s. tag_block_end ( i ) ) ,
1105
+ peek ( s. tag_block_end ( ) ) ,
1115
1106
) ;
1116
1107
1117
1108
let mut p = (
@@ -1121,7 +1112,7 @@ impl<'a> Raw<'a> {
1121
1112
Some ( "raw" ) ,
1122
1113
(
1123
1114
opt ( Whitespace :: parse) ,
1124
- | i : & mut _ | s. tag_block_end ( i ) ,
1115
+ s. tag_block_end ( ) ,
1125
1116
skip_till ( Splitter1 :: new ( s. syntax . block_start ) , endraw) . with_taken ( ) ,
1126
1117
) ,
1127
1118
) ,
@@ -1212,7 +1203,7 @@ impl<'a> If<'a> {
1212
1203
Some ( "if" ) ,
1213
1204
(
1214
1205
opt ( Whitespace :: parse) ,
1215
- | i : & mut _ | s. tag_block_end ( i ) ,
1206
+ s. tag_block_end ( ) ,
1216
1207
cut_node (
1217
1208
Some ( "if" ) ,
1218
1209
(
0 commit comments