@@ -299,22 +299,20 @@ impl fmt::Default for clean::Type {
299
299
f. buf . write ( s. as_bytes ( ) ) ;
300
300
}
301
301
clean:: Closure ( ref decl) => {
302
- f. buf . write ( match decl. sigil {
303
- ast:: BorrowedSigil => "&" ,
304
- ast:: ManagedSigil => "@" ,
305
- ast:: OwnedSigil => "~" ,
306
- } . as_bytes ( ) ) ;
307
- match decl. region {
308
- Some ( ref region) => write ! ( f. buf, "{} " , * region) ,
309
- None => { }
310
- }
311
- write ! ( f. buf, "{}{}fn{}" ,
302
+ let region = match decl. region {
303
+ Some ( ref region) => format ! ( "{} " , * region) ,
304
+ None => ~"",
305
+ } ;
306
+
307
+ write ! ( f. buf, "{}{}{arrow, select, yes{ -> {ret}} other{}}" ,
312
308
PuritySpace ( decl. purity) ,
313
- match decl. onceness {
314
- ast:: Once => "once " ,
315
- ast:: Many => "" ,
309
+ match decl. sigil {
310
+ ast:: OwnedSigil => format!( "proc({})" , decl. decl. inputs) ,
311
+ ast:: BorrowedSigil => format!( "{}|{}|" , region, decl. decl. inputs) ,
312
+ ast:: ManagedSigil => format!( "@{}fn({})" , region, decl. decl. inputs) ,
316
313
} ,
317
- decl. decl) ;
314
+ arrow = match decl. decl. output { clean:: Unit => "no" , _ => "yes" } ,
315
+ ret = decl. decl. output) ;
318
316
// XXX: where are bounds and lifetimes printed?!
319
317
}
320
318
clean:: BareFunction ( ref decl) => {
@@ -374,18 +372,24 @@ impl fmt::Default for clean::Type {
374
372
375
373
impl fmt:: Default for clean:: FnDecl {
376
374
fn fmt ( d : & clean:: FnDecl , f : & mut fmt:: Formatter ) {
375
+ write ! ( f. buf, "({args}){arrow, select, yes{ -> {ret}} other{}}" ,
376
+ args = d. inputs,
377
+ arrow = match d. output { clean:: Unit => "no" , _ => "yes" } ,
378
+ ret = d. output) ;
379
+ }
380
+ }
381
+
382
+ impl fmt:: Default for ~[ clean:: Argument ] {
383
+ fn fmt ( inputs : & ~[ clean:: Argument ] , f : & mut fmt:: Formatter ) {
377
384
let mut args = ~"";
378
- for ( i, input) in d . inputs . iter ( ) . enumerate ( ) {
385
+ for ( i, input) in inputs. iter ( ) . enumerate ( ) {
379
386
if i > 0 { args. push_str ( ", " ) ; }
380
387
if input. name . len ( ) > 0 {
381
388
args. push_str ( format ! ( "{}: " , input. name) ) ;
382
389
}
383
390
args. push_str ( format ! ( "{}" , input. type_) ) ;
384
391
}
385
- write ! ( f. buf, "({args}){arrow, select, yes{ -> {ret}} other{}}" ,
386
- args = args,
387
- arrow = match d. output { clean:: Unit => "no" , _ => "yes" } ,
388
- ret = d. output) ;
392
+ f. buf . write ( args. as_bytes ( ) ) ;
389
393
}
390
394
}
391
395
0 commit comments