mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-05-06 12:10:02 +00:00
Refactor: Mv debug!
into create_request
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
ad41756daa
commit
74a6e137be
1 changed files with 2 additions and 4 deletions
|
@ -52,6 +52,8 @@ pub async fn remote_exists(url: Url, method: Method) -> Result<bool, BinstallErr
|
|||
async fn create_request(
|
||||
url: Url,
|
||||
) -> Result<impl Stream<Item = reqwest::Result<Bytes>>, BinstallError> {
|
||||
debug!("Downloading from: '{url}'");
|
||||
|
||||
reqwest::get(url.clone())
|
||||
.await
|
||||
.and_then(|r| r.error_for_status())
|
||||
|
@ -69,8 +71,6 @@ pub async fn download_and_extract<P: AsRef<Path>>(
|
|||
fmt: PkgFmt,
|
||||
path: P,
|
||||
) -> Result<(), BinstallError> {
|
||||
debug!("Downloading from: '{url}'");
|
||||
|
||||
let stream = create_request(url).await?;
|
||||
|
||||
let path = path.as_ref();
|
||||
|
@ -97,8 +97,6 @@ pub async fn download_tar_based_and_visit<V: TarEntriesVisitor + Debug + Send +
|
|||
fmt: TarBasedFmt,
|
||||
visitor: V,
|
||||
) -> Result<V, BinstallError> {
|
||||
debug!("Downloading from: '{url}'");
|
||||
|
||||
let stream = create_request(url).await?;
|
||||
|
||||
debug!("Downloading and extracting then in-memory processing");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue