blob: 0daeff8197517403fec221ab153bd73ca5f3aaf3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
iface to_bytes {
fn to_bytes() -> ~[u8];
}
impl of to_bytes for ~[u8] {
fn to_bytes() -> ~[u8] { copy self }
}
impl of to_bytes for @~[u8] {
fn to_bytes() -> ~[u8] { copy *self }
}
impl of to_bytes for ~str {
fn to_bytes() -> ~[u8] { str::bytes(self) }
}
impl of to_bytes for @(~str) {
fn to_bytes() -> ~[u8] { str::bytes(*self) }
}
|