musicbrainz-light 0.1.3

A lightweight MusicBrainz database importer and processor
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use bzip2::bufread::BzDecoder;
use std::{
    fs::File,
    io::{BufReader, Read},
    path::Path,
};
use tar::Archive;

use crate::error::MbLightResult;

pub fn get_archive(tmpfile: &Path) -> MbLightResult<Archive<impl Read>> {
    let f = File::open(tmpfile)?;
    let reader = BufReader::new(f);
    let decompressor = BzDecoder::new(reader);
    let archive = Archive::new(decompressor);
    Ok(archive)
}