File tree 3 files changed +3
-7
lines changed
3 files changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -1204,13 +1204,9 @@ pub(crate) fn format_trait(
1204
1204
}
1205
1205
result. push_str ( & where_clause_str) ;
1206
1206
}
1207
- let pre_block_span = if !generics. where_clause . predicates . is_empty ( ) {
1208
- mk_sp ( generics. where_clause . span . hi ( ) , item. span . hi ( ) )
1209
- } else if !generic_bounds. is_empty ( ) {
1210
- mk_sp ( generic_bounds. last ( ) . unwrap ( ) . span ( ) . hi ( ) , item. span . hi ( ) )
1211
- } else {
1212
- item. span
1213
- } ;
1207
+
1208
+ /* Note: `where_clause` always exists; Span is empty when no where clause in the code */
1209
+ let pre_block_span = mk_sp ( generics. where_clause . span . hi ( ) , item. span . hi ( ) ) ;
1214
1210
let pre_block_snippet = context. snippet ( pre_block_span) ;
1215
1211
if let Some ( lo) = pre_block_snippet. find ( '/' ) {
1216
1212
// 1 = `{`
File renamed without changes.
File renamed without changes.
You can’t perform that action at this time.
0 commit comments