PSeitz / lz4_flex

Fastest pure Rust implementation of LZ4 compression/decompression.
MIT License
441 stars 28 forks source link

v0.9.1 does not compile when default-features = false #33

Closed mdecimus closed 2 years ago

mdecimus commented 2 years ago

Hi, as the title suggests, version 0.9.1 does not compile when default-features = false. Looks like an import is missing.

error[E0412]: cannot find type `Vec` in this scope
  --> /home/vagrant/.cargo/registry/src/github.com-1ecc6299db9ec823/lz4_flex-0.9.1/src/sink.rs:13:15
   |
13 |     vec: &mut Vec<u8>,
   |               ^^^ not found in this scope
   |
help: consider importing one of these items
   |
4  | use alloc::vec::Vec;
   |
4  | use crate::block::hashtable::Vec;
   |

error[E0412]: cannot find type `Vec` in this scope
   --> /home/vagrant/.cargo/registry/src/github.com-1ecc6299db9ec823/lz4_flex-0.9.1/src/sink.rs:228:21
    |
228 |     output: &'a mut Vec<u8>,
    |                     ^^^ not found in this scope
    |
help: consider importing one of these items
    |
4   | use alloc::vec::Vec;
    |
4   | use crate::block::hashtable::Vec;
    |

error[E0412]: cannot find type `Vec` in this scope
   --> /home/vagrant/.cargo/registry/src/github.com-1ecc6299db9ec823/lz4_flex-0.9.1/src/sink.rs:247:32
    |
247 |     pub fn new(output: &'a mut Vec<u8>, offset: usize, pos: usize) -> VecSink<'a> {
    |                                ^^^ not found in this scope
    |
help: consider importing one of these items
    |
4   | use alloc::vec::Vec;
    |
4   | use crate::block::hashtable::Vec;
    |
PSeitz commented 2 years ago

Hi thanks the report, there were some conditional imports wrong, it's fixed with 0.9.2 and I added a test for it.

mdecimus commented 2 years ago

Thanks for the quick fix!