Convert std::bitv to istrs. Issue #855

This commit is contained in:
Brian Anderson 2011-08-23 20:10:08 -07:00
parent 805e3098c5
commit 2c8a93aa3b

View File

@ -151,9 +151,11 @@ fn to_vec(v: &t) -> [uint] {
ret vec::init_fn::<uint>(sub, v.nbits);
}
fn to_str(v: &t) -> str {
let rs = "";
for i: uint in to_vec(v) { if i == 1u { rs += "1"; } else { rs += "0"; } }
fn to_str(v: &t) -> istr {
let rs = ~"";
for i: uint in to_vec(v) {
if i == 1u { rs += ~"1"; } else { rs += ~"0"; }
}
ret rs;
}