2012-08-14 14:11:15 -05:00
|
|
|
// NB: transitionary, de-mode-ing.
|
|
|
|
#[forbid(deprecated_mode)];
|
|
|
|
#[forbid(deprecated_pattern)];
|
|
|
|
|
2012-08-13 18:20:27 -05:00
|
|
|
trait ToBytes {
|
2012-07-03 23:30:09 -05:00
|
|
|
fn to_bytes() -> ~[u8];
|
|
|
|
}
|
|
|
|
|
2012-08-13 18:20:27 -05:00
|
|
|
impl ~[u8]: ToBytes {
|
2012-07-03 23:30:09 -05:00
|
|
|
fn to_bytes() -> ~[u8] { copy self }
|
|
|
|
}
|
|
|
|
|
2012-08-13 18:20:27 -05:00
|
|
|
impl @~[u8]: ToBytes {
|
2012-07-03 23:30:09 -05:00
|
|
|
fn to_bytes() -> ~[u8] { copy *self }
|
|
|
|
}
|
|
|
|
|
2012-08-13 18:20:27 -05:00
|
|
|
impl ~str: ToBytes {
|
2012-08-23 17:44:57 -05:00
|
|
|
fn to_bytes() -> ~[u8] { str::to_bytes(self) }
|
2012-07-03 23:30:09 -05:00
|
|
|
}
|
|
|
|
|
2012-08-13 18:20:27 -05:00
|
|
|
impl @(~str): ToBytes {
|
2012-08-23 17:44:57 -05:00
|
|
|
fn to_bytes() -> ~[u8] { str::to_bytes(*self) }
|
2012-07-03 23:30:09 -05:00
|
|
|
}
|