use super::Error;
use std::str;

pub fn to_string(output: Vec<u8>) -> Result<String, Error> {
    match str::from_utf8(&output) {
        Ok(str) => Ok(str.to_owned()),
        Err(_)  => Err(Error::from_str("Invalid UTF8 sequence"))
    }
}