mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-22 13:38:43 +00:00
Impl helpers::await_task
: Handle JoinError
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
730f7d6c15
commit
5e7aab7373
1 changed files with 5 additions and 0 deletions
|
@ -37,6 +37,11 @@ pub use tls_version::TLSVersion;
|
|||
mod crate_name;
|
||||
pub use crate_name::CrateName;
|
||||
|
||||
pub async fn await_task<T>(task: tokio::task::JoinHandle<T>) -> miette::Result<T> {
|
||||
task.await
|
||||
.map_err(|join_err| miette::miette!("Task failed to join: {}", join_err))
|
||||
}
|
||||
|
||||
/// Load binstall metadata from the crate `Cargo.toml` at the provided path
|
||||
pub fn load_manifest_path<P: AsRef<Path>>(
|
||||
manifest_path: P,
|
||||
|
|
Loading…
Add table
Reference in a new issue