pub fn compress_and_write<T: Serialize>(data: Vec<T>, path: &str) -> Result<()> {
    println!("Writing {} entries to {}", data.len(), path);
    let encoded = bincode::serialize(&data)?;

    let mut writer = flate2::write::GzEncoder::new(Vec::new(), Compression::best());
    writer.write_all(&encoded)?;
    write(
        [env!("CARGO_MANIFEST_DIR"), "/../../", path].concat(),
        &writer.finish()?,
    )?;

    Ok(())
}
/// Writes data to file provided in compressed binary format (.bc.gz)
Writes data to file provided in compressed binary format (.bc.gz)
Writes data to file provided in compressed binary format ( . bc . gz )
pub fn compress_and_write<T: Serialize>(data: Vec<T>, path: &str) -> Result<()> {
    println!("Writing {} entries to {}", data.len(), path);
    let encoded = bincode::serialize(&data)?;
    let mut writer = flate2::write::GzEncoder::new(Vec::new(), Compression::best());
    writer.write_all(&encoded)?;
    write(
        [env!("CARGO_MANIFEST_DIR"), "/../../", path].concat(),
        &writer.finish()?,
    )?;
    Ok(())
}
pub fn compress_and_write < T : Serialize > ( data : Vec < T > , path : & str ) -> Result < ( ) > { println ! ( " " data len ( ) path ) ; let encoded = bincode :: serialize ( & data ) ? ; let mut writer = flate2 :: write :: GzEncoder :: new ( Vec :: new ( ) , Compression :: best ( ) ) ; writer . write_all ( & encoded ) ? ; write ( [ env ! ( " " ) , " " , path ] . concat ( ) , & writer . finish ( ) ? , ) ? ; Ok ( ( ) ) }
Writes data to file provided in compressed binary format (.bc.gz)
Writes data to file provided in compressed binary format ( . bc . gz )
data
Vec<T>
path
&str
data
Vec<T>
path
&str