@@ -8,7 +8,7 @@ use rustc_span::BytePos;
8
8
use crate :: comment:: { find_comment_end, rewrite_comment, FindUncommented } ;
9
9
use crate :: config:: lists:: * ;
10
10
use crate :: config:: { Config , IndentStyle } ;
11
- use crate :: rewrite:: RewriteContext ;
11
+ use crate :: rewrite:: { RewriteContext , RewriteResult } ;
12
12
use crate :: shape:: { Indent , Shape } ;
13
13
use crate :: utils:: {
14
14
count_newlines, first_line_width, last_line_width, mk_sp, starts_with_newline,
@@ -281,6 +281,7 @@ where
281
281
let indent_str = & formatting. shape . indent . to_string ( formatting. config ) ;
282
282
while let Some ( ( i, item) ) = iter. next ( ) {
283
283
let item = item. as_ref ( ) ;
284
+ // TODO here Is it possible to 실제로 list item이 없으면..
284
285
let inner_item = item. item . as_ref ( ) ?;
285
286
let first = i == 0 ;
286
287
let last = iter. peek ( ) . is_none ( ) ;
@@ -741,7 +742,7 @@ where
741
742
I : Iterator < Item = T > ,
742
743
F1 : Fn ( & T ) -> BytePos ,
743
744
F2 : Fn ( & T ) -> BytePos ,
744
- F3 : Fn ( & T ) -> Option < String > ,
745
+ F3 : Fn ( & T ) -> RewriteResult ,
745
746
{
746
747
type Item = ListItem ;
747
748
@@ -778,7 +779,7 @@ where
778
779
item : if self . inner . peek ( ) . is_none ( ) && self . leave_last {
779
780
None
780
781
} else {
781
- ( self . get_item_string ) ( & item)
782
+ ( self . get_item_string ) ( & item) . ok ( )
782
783
} ,
783
784
post_comment,
784
785
new_lines,
@@ -805,7 +806,7 @@ where
805
806
I : Iterator < Item = T > ,
806
807
F1 : Fn ( & T ) -> BytePos ,
807
808
F2 : Fn ( & T ) -> BytePos ,
808
- F3 : Fn ( & T ) -> Option < String > ,
809
+ F3 : Fn ( & T ) -> RewriteResult ,
809
810
{
810
811
ListItems {
811
812
snippet_provider,
0 commit comments