Skip to content
Snippets Groups Projects
Commit 63d9f99b authored by TatriX's avatar TatriX
Browse files

Update flate2 to the latest version

parent 107ed1af
No related branches found
No related tags found
No related merge requests found
......@@ -20,6 +20,6 @@ name = "example"
path = "examples/main.rs"
[dependencies]
flate2 = "0.2.13"
base64 = "0.1.1"
xml-rs = "0.3.0"
flate2 = "1.0.1"
......@@ -802,15 +802,9 @@ fn decode_zlib(data: Vec<u8>) -> Result<Vec<u8>, TiledError> {
}
fn decode_gzip(data: Vec<u8>) -> Result<Vec<u8>, TiledError> {
let mut gzd = match GzDecoder::new(BufReader::new(&data[..])) {
Ok(gzd) => gzd,
Err(e) => return Err(TiledError::DecompressingError(e))
};
let mut gzd = GzDecoder::new(BufReader::new(&data[..]));
let mut data = Vec::new();
match gzd.read_to_end(&mut data) {
Ok(_v) => {},
Err(e) => return Err(TiledError::DecompressingError(e))
}
gzd.read_to_end(&mut data).map_err(|e| TiledError::DecompressingError(e))?;
Ok(data)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment