mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-20 20:48:43 +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 serde::Serialize;
|
||||
use tinytemplate::TinyTemplate;
|
||||
use tokio::task::block_in_place;
|
||||
use url::Url;
|
||||
|
||||
use crate::{BinstallError, Meta, PkgFmt, PkgFmtDecomposed, TarBasedFmt};
|
||||
|
@ -38,13 +39,15 @@ pub static REQWESTGLOBALCONFIG: OnceCell<(bool, Option<TLSVersion>)> = OnceCell:
|
|||
pub fn load_manifest_path<P: AsRef<Path>>(
|
||||
manifest_path: P,
|
||||
) -> Result<Manifest<Meta>, BinstallError> {
|
||||
debug!("Reading manifest: {}", manifest_path.as_ref().display());
|
||||
block_in_place(|| {
|
||||
debug!("Reading manifest: {}", manifest_path.as_ref().display());
|
||||
|
||||
// Load and parse manifest (this checks file system for binary output names)
|
||||
let manifest = Manifest::<Meta>::from_path_with_metadata(manifest_path)?;
|
||||
// Load and parse manifest (this checks file system for binary output names)
|
||||
let manifest = Manifest::<Meta>::from_path_with_metadata(manifest_path)?;
|
||||
|
||||
// Return metadata
|
||||
Ok(manifest)
|
||||
// Return metadata
|
||||
Ok(manifest)
|
||||
})
|
||||
}
|
||||
|
||||
pub fn new_reqwest_client_builder() -> ClientBuilder {
|
||||
|
|
Loading…
Add table
Reference in a new issue