summary refs log tree commit diff
path: root/src/libcore/to_bytes.rs
blob: 4bfd16344cbd57e80df29e083d8deb2f4743f29c (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) }
}