@@ -268,34 +268,26 @@ mod rt {
268
268
269
269
// FIXME: May not want to use a vector here for flags;
270
270
// instead just use a bool per flag
271
- type conv = { flags : vec [ flag ] , width : count , precision : count , ty: ty} ;
271
+ type conv = { flags : [ flag ] , width : count , precision : count , ty: ty} ;
272
272
273
- type conv_ivec = { flags : [ flag ] , width : count , precision : count , ty: ty} ;
274
-
275
- fn to_conv_ivec ( cv : & conv ) -> conv_ivec {
276
- { flags: ivec:: from_vec ( cv. flags ) ,
277
- width: cv. width ,
278
- precision: cv. precision ,
279
- ty: cv. ty }
273
+ // FIXME: Remove these transitional *_ivec interfaces
274
+ fn conv_int_ivec ( cv : & conv , i : int ) -> str {
275
+ conv_int ( cv, i)
280
276
}
281
-
282
- fn conv_int ( cv : & conv , i : int ) -> str {
283
- conv_int_ivec ( to_conv_ivec ( cv) , i)
277
+ fn conv_uint_ivec ( cv : & conv , u : uint ) -> str {
278
+ conv_uint ( cv, u)
284
279
}
285
- fn conv_uint ( cv : & conv , u : uint ) -> str {
286
- conv_uint_ivec ( to_conv_ivec ( cv ) , u )
280
+ fn conv_bool_ivec ( cv : & conv , b : bool ) -> str {
281
+ conv_bool ( cv , b )
287
282
}
288
- fn conv_bool ( cv : & conv , b : bool ) -> str {
289
- conv_bool_ivec ( to_conv_ivec ( cv ) , b )
283
+ fn conv_char_ivec ( cv : & conv , c : char ) -> str {
284
+ conv_char ( cv , c )
290
285
}
291
- fn conv_char ( cv : & conv , c : char ) -> str {
292
- conv_char_ivec ( to_conv_ivec ( cv) , c)
293
- }
294
- fn conv_str ( cv : & conv , s : str ) -> str {
295
- conv_str_ivec ( to_conv_ivec ( cv) , s)
286
+ fn conv_str_ivec ( cv : & conv , s : str ) -> str {
287
+ conv_str ( cv, s)
296
288
}
297
289
298
- fn conv_int_ivec ( cv : & conv_ivec , i : int ) -> str {
290
+ fn conv_int ( cv : & conv , i : int ) -> str {
299
291
let radix = 10 u;
300
292
let prec = get_int_precision ( cv) ;
301
293
let s = int_to_str_prec ( i, radix, prec) ;
@@ -308,7 +300,7 @@ mod rt {
308
300
}
309
301
ret pad( cv, s, pad_signed) ;
310
302
}
311
- fn conv_uint_ivec ( cv : & conv_ivec , u : uint ) -> str {
303
+ fn conv_uint ( cv : & conv , u : uint ) -> str {
312
304
let prec = get_int_precision ( cv) ;
313
305
let rs =
314
306
alt cv. ty {
@@ -320,17 +312,17 @@ mod rt {
320
312
} ;
321
313
ret pad( cv, rs, pad_unsigned) ;
322
314
}
323
- fn conv_bool_ivec ( cv : & conv_ivec , b : bool ) -> str {
315
+ fn conv_bool ( cv : & conv , b : bool ) -> str {
324
316
let s = if b { "true" } else { "false" } ;
325
317
// run the boolean conversion through the string conversion logic,
326
318
// giving it the same rules for precision, etc.
327
319
328
320
ret conv_str_ivec ( cv, s) ;
329
321
}
330
- fn conv_char_ivec ( cv : & conv_ivec , c : char ) -> str {
322
+ fn conv_char ( cv : & conv , c : char ) -> str {
331
323
ret pad ( cv, str:: from_char ( c) , pad_nozero) ;
332
324
}
333
- fn conv_str_ivec ( cv : & conv_ivec , s : str ) -> str {
325
+ fn conv_str ( cv : & conv , s : str ) -> str {
334
326
// For strings, precision is the maximum characters
335
327
// displayed
336
328
@@ -371,7 +363,7 @@ mod rt {
371
363
} else { s }
372
364
} ;
373
365
}
374
- fn get_int_precision ( cv : & conv_ivec ) -> uint {
366
+ fn get_int_precision ( cv : & conv ) -> uint {
375
367
ret alt cv. precision {
376
368
count_is ( c) { c as uint }
377
369
count_implied. { 1 u }
@@ -385,7 +377,7 @@ mod rt {
385
377
ret str:: unsafe_from_bytes ( svec) ;
386
378
}
387
379
tag pad_mode { pad_signed; pad_unsigned; pad_nozero; }
388
- fn pad ( cv : & conv_ivec , s : str , mode : pad_mode ) -> str {
380
+ fn pad ( cv : & conv , s : str , mode : pad_mode ) -> str {
389
381
let uwidth;
390
382
alt cv. width {
391
383
count_implied. { ret s ; }
@@ -413,7 +405,7 @@ mod rt {
413
405
pad_signed. { might_zero_pad = true ; signed = true ; }
414
406
pad_unsigned. { might_zero_pad = true ; }
415
407
}
416
- fn have_precision ( cv : & conv_ivec ) -> bool {
408
+ fn have_precision ( cv : & conv ) -> bool {
417
409
ret alt cv. precision { count_implied. { false } _ { true } } ;
418
410
}
419
411
let zero_padding = false ;
0 commit comments