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