use std::io::prelude::*;
fn main() {
let input = std::fs::read("linux-5.14.1.tar.xz").unwrap();
let mut output = Vec::new();
xz::read::XzDecoder::new(&*input)
.read_to_end(&mut output)
.unwrap();
}
$ cargo run
Finished dev [unoptimized + debuginfo] target(s) in 0.02s
Running `/home/nixon/git/nixos/target/debug/why`
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Custom { kind: Other, error: "corrupt xz stream" }', why/src/main.rs:8:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
xz2
cannot extract the xz file for the linux source code