use flate2::read::GzDecoder;
use std::fs::File;
use std::io::Seek;
use std::path::Path;
use tar::Archive;
pub fn decompress_tarball(
tarball: &mut File,
destination: impl AsRef<Path>,
) -> Result<(), std::io::Error> {
tarball.rewind()?;
let mut archive = Archive::new(GzDecoder::new(tarball));
archive.unpack(destination)
}