File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -657,7 +657,6 @@ impl<'a> fmt::Display for Method<'a> {
657
657
let decl = self . 0 ;
658
658
let mut args = String :: new ( ) ;
659
659
for ( i, input) in decl. inputs . values . iter ( ) . enumerate ( ) {
660
- if i > 0 || !args. is_empty ( ) { args. push_str ( ", " ) ; }
661
660
if let Some ( selfty) = input. to_self ( ) {
662
661
match selfty {
663
662
clean:: SelfValue => args. push_str ( "self" ) ,
@@ -672,11 +671,16 @@ impl<'a> fmt::Display for Method<'a> {
672
671
}
673
672
}
674
673
} else {
674
+ args. push_str ( "\n " ) ;
675
675
if !input. name . is_empty ( ) {
676
676
args. push_str ( & format ! ( "{}: " , input. name) ) ;
677
677
}
678
678
args. push_str ( & format ! ( "{}" , input. type_) ) ;
679
679
}
680
+ if i + 1 < decl. inputs . values . len ( ) { args. push_str ( "," ) ; }
681
+ }
682
+ if let Some ( None ) = decl. inputs . values . iter ( ) . last ( ) . map ( |val| val. to_self ( ) ) {
683
+ args. push_str ( "\n " ) ;
680
684
}
681
685
write ! ( f, "({args}){arrow}" , args = args, arrow = decl. output)
682
686
}
You can’t perform that action at this time.
0 commit comments