use std::str; use std::vec::Vec; use rustc_serialize::Decodable; use rustc_serialize::json; pub struct StripeDecoder(T); pub type StripeDecoderError = json::DecoderError; impl StripeDecoder { pub fn decode(data: Vec) -> Result { let data = str::from_utf8(data.as_slice()); json::decode(data.unwrap()) } }