From 1a2a8b6b1746241c8781b89c5974d6fcb0148774 Mon Sep 17 00:00:00 2001 From: Michael Sullivan Date: Tue, 19 Jul 2011 20:11:48 -0700 Subject: [PATCH] Have fn_to_str use proto_to_str. --- src/comp/util/ppaux.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/comp/util/ppaux.rs b/src/comp/util/ppaux.rs index da76e7822ae..305ef84b85a 100644 --- a/src/comp/util/ppaux.rs +++ b/src/comp/util/ppaux.rs @@ -11,6 +11,7 @@ import syntax::print::pp; import syntax::print::pprust; import syntax::print::pprust::path_to_str; import syntax::print::pprust::constr_args_to_str; +import syntax::print::pprust::proto_to_str; import pp::word; import pp::eof; import pp::zerobreak; @@ -49,11 +50,7 @@ fn ty_to_str(&ctxt cx, &t typ) -> str { fn fn_to_str(&ctxt cx, ast::proto proto, option::t[ast::ident] ident, &arg[] inputs, t output, ast::controlflow cf, &(@constr)[] constrs) -> str { - auto s; - alt (proto) { - case (ast::proto_iter) { s = "iter"; } - case (ast::proto_fn) { s = "fn"; } - } + auto s = proto_to_str(proto); alt (ident) { case (some(?i)) { s += " "; s += i; } case (_) { } } s += "("; auto strs = [];