mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-22 13:38:43 +00:00
Construct BinstallError
from JoinError
in main
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
6e5ecc46cf
commit
d39bc0acab
1 changed files with 10 additions and 7 deletions
17
src/main.rs
17
src/main.rs
|
@ -172,13 +172,16 @@ fn main() -> MainExit {
|
||||||
let done = start.elapsed();
|
let done = start.elapsed();
|
||||||
debug!("run time: {done:?}");
|
debug!("run time: {done:?}");
|
||||||
|
|
||||||
result.map_or_else(MainExit::JoinErr, |res| {
|
result.map_or_else(
|
||||||
res.map(|_| MainExit::Success(done)).unwrap_or_else(|err| {
|
|join_err| MainExit::Error(BinstallError::from(join_err)),
|
||||||
err.downcast::<BinstallError>()
|
|res| {
|
||||||
.map(MainExit::Error)
|
res.map(|_| MainExit::Success(done)).unwrap_or_else(|err| {
|
||||||
.unwrap_or_else(MainExit::Report)
|
err.downcast::<BinstallError>()
|
||||||
})
|
.map(MainExit::Error)
|
||||||
})
|
.unwrap_or_else(MainExit::Report)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> {
|
async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> {
|
||||||
|
|
Loading…
Add table
Reference in a new issue