File tree Expand file tree Collapse file tree 1 file changed +3
-14
lines changed
crates/oxc_formatter/src/formatter Expand file tree Collapse file tree 1 file changed +3
-14
lines changed Original file line number Diff line number Diff line change @@ -426,30 +426,19 @@ impl<'a> Format<'a> for FormatDanglingComments<'a> {
426426}
427427
428428impl < ' a > Format < ' a > for Comment {
429- #[ expect( clippy:: cast_possible_truncation) ]
430429 fn fmt ( & self , f : & mut Formatter < ' _ , ' a > ) {
431430 let source_text = f. source_text ( ) . text_for ( & self . span ) . trim_end ( ) ;
432431 if is_alignable_comment ( source_text) {
433- let mut source_offset = self . span . start ;
434-
435432 let mut lines = source_text. lines ( ) ;
436433
437434 // `is_alignable_comment` only returns `true` for multiline comments
438435 let first_line = lines. next ( ) . unwrap ( ) ;
439436 write ! ( f, [ text( first_line. trim_end( ) ) ] ) ;
440437
441- source_offset += first_line. len ( ) as u32 ;
442-
443438 // Indent the remaining lines by one space so that all `*` are aligned.
444- write ! (
445- f,
446- [ & format_once( |f| {
447- for line in lines {
448- write!( f, [ hard_line_break( ) , " " , text( line. trim( ) ) ] ) ;
449- source_offset += line. len( ) as u32 ;
450- }
451- } ) ]
452- ) ;
439+ for line in lines {
440+ write ! ( f, [ hard_line_break( ) , " " , text( line. trim( ) ) ] ) ;
441+ }
453442 } else {
454443 write ! ( f, [ text( source_text) ] ) ;
455444 }
You can’t perform that action at this time.
0 commit comments