use std::io::{Error};
use quoted_printable::{decode as qp_decode, ParseMode, encode as qp_encode};
pub fn decode<T: AsRef<[u8]>>(text: T) -> Result<Vec<u8>, Error> {
match qp_decode(text, ParseMode::Robust) {
Ok(e) => Ok(e),
Err(e) => Err(Error::other(e))
}
}
pub fn encode(text: &str) -> String {
let encoded = qp_encode(text);
String::from_utf8(encoded).unwrap()
}