1
1
import std:: io;
2
2
import std:: ivec;
3
- import std:: vec;
4
3
import std:: str;
5
4
import std:: int;
6
5
import std:: option;
@@ -107,23 +106,23 @@ fn ty_to_str(&ctxt cx, &t typ) -> str {
107
106
case ( ty_type) { s += "type" ; }
108
107
case ( ty_task) { s += "task" ; }
109
108
case ( ty_tup ( ?elems) ) {
110
- let vec [ str] strs = [ ] ;
111
- for ( mt tm in elems) { strs += [ mt_to_str ( cx, tm) ] ; }
112
- s += "tup(" + str:: connect ( strs, "," ) + ")" ;
109
+ let str [ ] strs = ~ [ ] ;
110
+ for ( mt tm in elems) { strs += ~ [ mt_to_str ( cx, tm) ] ; }
111
+ s += "tup(" + str:: connect_ivec ( strs, "," ) + ")" ;
113
112
}
114
113
case ( ty_rec ( ?elems) ) {
115
- let vec [ str] strs = [ ] ;
116
- for ( field fld in elems) { strs += [ field_to_str ( cx, fld) ] ; }
117
- s += "rec(" + str:: connect ( strs, "," ) + ")" ;
114
+ let str [ ] strs = ~ [ ] ;
115
+ for ( field fld in elems) { strs += ~ [ field_to_str ( cx, fld) ] ; }
116
+ s += "rec(" + str:: connect_ivec ( strs, "," ) + ")" ;
118
117
}
119
118
case ( ty_tag ( ?id, ?tps) ) {
120
119
// The user should never see this if the cname is set properly!
121
120
122
121
s += "<tag#" + int:: str ( id. _0 ) + ":" + int:: str ( id. _1 ) + ">" ;
123
122
if ( ivec:: len[ t] ( tps) > 0 u) {
124
- let vec [ str] strs = [ ] ;
125
- for ( t typ in tps) { strs += [ ty_to_str ( cx, typ) ] ; }
126
- s += "[" + str:: connect ( strs, "," ) + "]" ;
123
+ let str [ ] strs = ~ [ ] ;
124
+ for ( t typ in tps) { strs += ~ [ ty_to_str ( cx, typ) ] ; }
125
+ s += "[" + str:: connect_ivec ( strs, "," ) + "]" ;
127
126
}
128
127
}
129
128
case ( ty_fn ( ?proto, ?inputs, ?output, ?cf, ?constrs) ) {
@@ -134,10 +133,9 @@ fn ty_to_str(&ctxt cx, &t typ) -> str {
134
133
ast:: return, ~[ ] ) ;
135
134
}
136
135
case ( ty_obj ( ?meths) ) {
137
- // TODO: Remove this ivec->vec conversion.
138
- auto strs = [ ] ;
139
- for ( method m in meths) { strs += [ method_to_str ( cx, m) ] ; }
140
- s += "obj {\n \t " + str:: connect ( strs, "\n \t " ) + "\n }" ;
136
+ auto strs = ~[ ] ;
137
+ for ( method m in meths) { strs += ~[ method_to_str ( cx, m) ] ; }
138
+ s += "obj {\n \t " + str:: connect_ivec ( strs, "\n \t " ) + "\n }" ;
141
139
}
142
140
case ( ty_res ( ?id, _, _) ) {
143
141
s += "<resource#" + int:: str ( id. _0 ) + ":" + int:: str ( id. _1 ) + ">" ;
0 commit comments