mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-21 13:08:42 +00:00
Run load_manifest_path
in block_in_place
mode
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
a35db557ea
commit
60caa9ee17
1 changed files with 8 additions and 5 deletions
|
@ -9,6 +9,7 @@ use once_cell::sync::OnceCell;
|
||||||
use reqwest::{Client, ClientBuilder, Method, Response};
|
use reqwest::{Client, ClientBuilder, Method, Response};
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
use tinytemplate::TinyTemplate;
|
use tinytemplate::TinyTemplate;
|
||||||
|
use tokio::task::block_in_place;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
use crate::{BinstallError, Meta, PkgFmt, PkgFmtDecomposed, TarBasedFmt};
|
use crate::{BinstallError, Meta, PkgFmt, PkgFmtDecomposed, TarBasedFmt};
|
||||||
|
@ -38,6 +39,7 @@ pub static REQWESTGLOBALCONFIG: OnceCell<(bool, Option<TLSVersion>)> = OnceCell:
|
||||||
pub fn load_manifest_path<P: AsRef<Path>>(
|
pub fn load_manifest_path<P: AsRef<Path>>(
|
||||||
manifest_path: P,
|
manifest_path: P,
|
||||||
) -> Result<Manifest<Meta>, BinstallError> {
|
) -> Result<Manifest<Meta>, BinstallError> {
|
||||||
|
block_in_place(|| {
|
||||||
debug!("Reading manifest: {}", manifest_path.as_ref().display());
|
debug!("Reading manifest: {}", manifest_path.as_ref().display());
|
||||||
|
|
||||||
// Load and parse manifest (this checks file system for binary output names)
|
// Load and parse manifest (this checks file system for binary output names)
|
||||||
|
@ -45,6 +47,7 @@ pub fn load_manifest_path<P: AsRef<Path>>(
|
||||||
|
|
||||||
// Return metadata
|
// Return metadata
|
||||||
Ok(manifest)
|
Ok(manifest)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new_reqwest_client_builder() -> ClientBuilder {
|
pub fn new_reqwest_client_builder() -> ClientBuilder {
|
||||||
|
|
Loading…
Add table
Reference in a new issue