Rewrite untar to take a visitor & simplify

signature of `download_and_extract_with_filter`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2022-06-11 20:31:46 +10:00
parent 5a43ee2681
commit 90a96cabc9
No known key found for this signature in database
GPG key ID: 591C0B03040416D6
4 changed files with 64 additions and 38 deletions

View file

@ -114,7 +114,7 @@ pub async fn fetch_crate_cratesio(
Url::parse(&crate_url)?,
TarBasedFmt::Tgz,
&temp_dir,
Some(move |path: &Path| path == cargo_toml || path == main || path.starts_with(&bin)),
move |path: &Path| path == cargo_toml || path == main || path.starts_with(&bin),
)
.await?;