Skip to content

Commit b451659

Browse files
committed
core: Add to_str impls for remaining int types
1 parent df83a79 commit b451659

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

src/libcore/to_str.rs

+20-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,28 @@
11
iface to_str { fn to_str() -> str; }
22

3-
impl of to_str for int {
4-
fn to_str() -> str { int::str(self) }
3+
impl of to_str for i8 {
4+
fn to_str() -> str { i8::str(self) }
55
}
6-
impl of to_str for uint {
7-
fn to_str() -> str { uint::str(self) }
6+
impl of to_str for i16 {
7+
fn to_str() -> str { i16::str(self) }
8+
}
9+
impl of to_str for i32 {
10+
fn to_str() -> str { i32::str(self) }
11+
}
12+
impl of to_str for i64 {
13+
fn to_str() -> str { i64::str(self) }
814
}
915
impl of to_str for u8 {
10-
fn to_str() -> str { uint::str(self as uint) }
16+
fn to_str() -> str { u8::str(self) }
17+
}
18+
impl of to_str for u16 {
19+
fn to_str() -> str { u16::str(self) }
20+
}
21+
impl of to_str for u32 {
22+
fn to_str() -> str { u32::str(self) }
23+
}
24+
impl of to_str for u64 {
25+
fn to_str() -> str { u64::str(self) }
1126
}
1227
impl of to_str for float {
1328
fn to_str() -> str { float::to_str(self, 4u) }

0 commit comments

Comments
 (0)