30
30
#![ feature( unique) ]
31
31
#![ cfg_attr( test, feature( rustc_private, rand, collections) ) ]
32
32
33
- #[ cfg( test) ] #[ macro_use] extern crate log;
33
+ #[ cfg( test) ]
34
+ #[ macro_use]
35
+ extern crate log;
34
36
35
37
extern crate libc;
36
38
@@ -123,7 +125,7 @@ pub fn deflate_bytes_zlib(bytes: &[u8]) -> Bytes {
123
125
deflate_bytes_internal ( bytes, LZ_NORM | TDEFL_WRITE_ZLIB_HEADER )
124
126
}
125
127
126
- fn inflate_bytes_internal ( bytes : & [ u8 ] , flags : c_int ) -> Result < Bytes , Error > {
128
+ fn inflate_bytes_internal ( bytes : & [ u8 ] , flags : c_int ) -> Result < Bytes , Error > {
127
129
unsafe {
128
130
let mut outsz: size_t = 0 ;
129
131
let res = tinfl_decompress_mem_to_heap ( bytes. as_ptr ( ) as * const _ ,
@@ -142,12 +144,12 @@ fn inflate_bytes_internal(bytes: &[u8], flags: c_int) -> Result<Bytes,Error> {
142
144
}
143
145
144
146
/// Decompress a buffer, without parsing any sort of header on the input.
145
- pub fn inflate_bytes ( bytes : & [ u8 ] ) -> Result < Bytes , Error > {
147
+ pub fn inflate_bytes ( bytes : & [ u8 ] ) -> Result < Bytes , Error > {
146
148
inflate_bytes_internal ( bytes, 0 )
147
149
}
148
150
149
151
/// Decompress a buffer that starts with a zlib header.
150
- pub fn inflate_bytes_zlib ( bytes : & [ u8 ] ) -> Result < Bytes , Error > {
152
+ pub fn inflate_bytes_zlib ( bytes : & [ u8 ] ) -> Result < Bytes , Error > {
151
153
inflate_bytes_internal ( bytes, TINFL_FLAG_PARSE_ZLIB_HEADER )
152
154
}
153
155
0 commit comments