| 1 | const TEXTrust-analyzer cargo zstd 0.13.3 TEXT.: &[u8] = include_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/include_bytes!!("../assets/example.txt"); |
| 2 | |
| 3 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 4 | #[should_panic] |
| 5 | fn test_issue_182rust-analyzer cargo zstd 0.13.3 test_issue_182().() { |
| 6 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::BufReadrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/BufRead#; |
| 7 | |
| 8 | let compressed = zstdrust-analyzer cargo zstd 0.13.3 crate/::encode_allrust-analyzer cargo zstd 0.13.3 stream/functions/encode_all().(TEXTrust-analyzer cargo zstd 0.13.3 TEXT., 3).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 9 | let truncated = &compressed[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeTo#compressed.lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Div<Self>`]div()./rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Div<Self>`]div(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Div<Self>`]div().2]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().; |
| 10 | |
| 11 | let rdr = zstdrust-analyzer cargo zstd 0.13.3 crate/::Decoderrust-analyzer cargo zstd 0.13.3 stream/read/Decoder#::newrust-analyzer cargo zstd 0.13.3 stream/read/impl#[`Decoder<'static, BufReader<R>>`]new().(truncated).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 12 | let rdr = stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::BufReaderrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/BufReader#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/impl#[`BufReader<R>`]new().(rdr); |
| 13 | for line in rdr.linesrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/BufRead#lines().() { |
| 14 | line.unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 15 | } |
| 16 | } |