tycho 0.1.2

A minimal, self-describing and traversable binary data format designed around rust and the serde data model.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use crate::error::{TychoResult, TychoError};
use flate2::write::GzDecoder;
use std::io::Write;

pub(crate) fn decompress(bytes: Vec<u8>) -> TychoResult<Vec<u8>> {
    let mut decoder = GzDecoder::new(Vec::new());
    decoder.write_all(&bytes)?;
    match decoder.finish() {
        Ok(x) => Ok(x),
        Err(e) => Err(TychoError::Io(e))
    }
}