use rustc_serialize::{Encoder, Encodable, Decoder, Decodable};
use super::DefaultId;
impl Encodable for DefaultId {
fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {
s.emit_str(&self.0[..])
}
}
impl Decodable for DefaultId {
fn decode<D: Decoder>(d: &mut D) -> Result<Self, D::Error> {
d.read_str().map( |s| DefaultId(s) )
}
}