Skip to content

Commit bc5cda3

Browse files
committed
libcore: Fix obsolete syntax in extfmt
1 parent d5e3cf0 commit bc5cda3

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

Diff for: src/libcore/unstable/extfmt.rs

+17-18
Original file line numberDiff line numberDiff line change
@@ -483,12 +483,12 @@ pub mod rt {
483483
use vec;
484484
use option::{Some, None, Option};
485485
486-
pub const flag_none : u32 = 0u32;
487-
pub const flag_left_justify : u32 = 0b00000000000001u32;
488-
pub const flag_left_zero_pad : u32 = 0b00000000000010u32;
489-
pub const flag_space_for_sign : u32 = 0b00000000000100u32;
490-
pub const flag_sign_always : u32 = 0b00000000001000u32;
491-
pub const flag_alternate : u32 = 0b00000000010000u32;
486+
pub static flag_none : u32 = 0u32;
487+
pub static flag_left_justify : u32 = 0b00000000000001u32;
488+
pub static flag_left_zero_pad : u32 = 0b00000000000010u32;
489+
pub static flag_space_for_sign : u32 = 0b00000000000100u32;
490+
pub static flag_sign_always : u32 = 0b00000000001000u32;
491+
pub static flag_alternate : u32 = 0b00000000010000u32;
492492
493493
pub enum Count { CountIs(uint), CountImplied, }
494494
@@ -501,7 +501,7 @@ pub mod rt {
501501
ty: Ty,
502502
}
503503
504-
pub pure fn conv_int(cv: Conv, i: int, buf: &mut ~str) {
504+
pub fn conv_int(cv: Conv, i: int, buf: &mut ~str) {
505505
let radix = 10;
506506
let prec = get_int_precision(cv);
507507
let mut s : ~str = uint_to_str_prec(int::abs(i) as uint, radix, prec);
@@ -517,7 +517,7 @@ pub mod rt {
517517
} else { Some('-') };
518518
unsafe { pad(cv, s, head, PadSigned, buf) };
519519
}
520-
pub pure fn conv_uint(cv: Conv, u: uint, buf: &mut ~str) {
520+
pub fn conv_uint(cv: Conv, u: uint, buf: &mut ~str) {
521521
let prec = get_int_precision(cv);
522522
let mut rs =
523523
match cv.ty {
@@ -529,16 +529,16 @@ pub mod rt {
529529
};
530530
unsafe { pad(cv, rs, None, PadUnsigned, buf) };
531531
}
532-
pub pure fn conv_bool(cv: Conv, b: bool, buf: &mut ~str) {
532+
pub fn conv_bool(cv: Conv, b: bool, buf: &mut ~str) {
533533
let s = if b { "true" } else { "false" };
534534
// run the boolean conversion through the string conversion logic,
535535
// giving it the same rules for precision, etc.
536536
conv_str(cv, s, buf);
537537
}
538-
pub pure fn conv_char(cv: Conv, c: char, buf: &mut ~str) {
538+
pub fn conv_char(cv: Conv, c: char, buf: &mut ~str) {
539539
unsafe { pad(cv, "", Some(c), PadNozero, buf) };
540540
}
541-
pub pure fn conv_str(cv: Conv, s: &str, buf: &mut ~str) {
541+
pub fn conv_str(cv: Conv, s: &str, buf: &mut ~str) {
542542
// For strings, precision is the maximum characters
543543
// displayed
544544
let mut unpadded = match cv.precision {
@@ -551,7 +551,7 @@ pub mod rt {
551551
};
552552
unsafe { pad(cv, unpadded, None, PadNozero, buf) };
553553
}
554-
pub pure fn conv_float(cv: Conv, f: float, buf: &mut ~str) {
554+
pub fn conv_float(cv: Conv, f: float, buf: &mut ~str) {
555555
let (to_str, digits) = match cv.precision {
556556
CountIs(c) => (float::to_str_exact, c as uint),
557557
CountImplied => (float::to_str_digits, 6u)
@@ -568,16 +568,15 @@ pub mod rt {
568568
} else { None };
569569
unsafe { pad(cv, s, head, PadFloat, buf) };
570570
}
571-
pub pure fn conv_poly<T>(cv: Conv, v: &T, buf: &mut ~str) {
571+
pub fn conv_poly<T>(cv: Conv, v: &T, buf: &mut ~str) {
572572
let s = sys::log_str(v);
573573
conv_str(cv, s, buf);
574574
}
575575
576576
// Convert a uint to string with a minimum number of digits. If precision
577577
// is 0 and num is 0 then the result is the empty string. Could move this
578578
// to uint: but it doesn't seem all that useful.
579-
pub pure fn uint_to_str_prec(num: uint, radix: uint,
580-
prec: uint) -> ~str {
579+
pub fn uint_to_str_prec(num: uint, radix: uint, prec: uint) -> ~str {
581580
return if prec == 0u && num == 0u {
582581
~""
583582
} else {
@@ -590,7 +589,7 @@ pub mod rt {
590589
} else { s }
591590
};
592591
}
593-
pub pure fn get_int_precision(cv: Conv) -> uint {
592+
pub fn get_int_precision(cv: Conv) -> uint {
594593
return match cv.precision {
595594
CountIs(c) => c as uint,
596595
CountImplied => 1u
@@ -637,7 +636,7 @@ pub mod rt {
637636
PadFloat => (true, true),
638637
PadUnsigned => (true, false)
639638
};
640-
pure fn have_precision(cv: Conv) -> bool {
639+
fn have_precision(cv: Conv) -> bool {
641640
return match cv.precision { CountImplied => false, _ => true };
642641
}
643642
let zero_padding = {
@@ -672,7 +671,7 @@ pub mod rt {
672671
buf.push_str(s);
673672
}
674673
#[inline(always)]
675-
pub pure fn have_flag(flags: u32, f: u32) -> bool {
674+
pub fn have_flag(flags: u32, f: u32) -> bool {
676675
flags & f != 0
677676
}
678677
}

0 commit comments

Comments
 (0)