mirror of
https://github.com/TxtDot/dalet-rs.git
synced 2025-02-28 05:11:24 +03:00
fix: decompress max capacity, clippy --fix
This commit is contained in:
parent
915c5c0a6d
commit
a5443bf0fc
9 changed files with 25 additions and 30 deletions
|
@ -17,15 +17,15 @@ macro_rules! iprint {
|
|||
}};
|
||||
}
|
||||
|
||||
pub fn compress_deflate(data: &Vec<u8>) -> std::io::Result<Vec<u8>> {
|
||||
pub fn compress_deflate(data: &[u8]) -> std::io::Result<Vec<u8>> {
|
||||
let mut c = flate2::write::DeflateEncoder::new(Vec::new(), Compression::default());
|
||||
c.write(data)?;
|
||||
c.write_all(data)?;
|
||||
c.finish()
|
||||
}
|
||||
|
||||
pub fn compress_zlib(data: &Vec<u8>) -> std::io::Result<Vec<u8>> {
|
||||
pub fn compress_zlib(data: &[u8]) -> std::io::Result<Vec<u8>> {
|
||||
let mut c = flate2::write::ZlibEncoder::new(Vec::new(), Compression::default());
|
||||
c.write(data)?;
|
||||
c.write_all(data)?;
|
||||
c.finish()
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ use dalet::parsers::gemtext::parse_gemtext;
|
|||
fn gem_text() {
|
||||
let text = include_str!("./gemtext.gmi");
|
||||
|
||||
let _ = parse_gemtext(&text).unwrap();
|
||||
let _ = parse_gemtext(text).unwrap();
|
||||
|
||||
// println!("{:#?}", parsed);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue