mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-06-14 14:46:37 +00:00
Accept no duration in MainExit::new
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
This commit is contained in:
parent
65ca3d57c0
commit
142d53db38
1 changed files with 2 additions and 2 deletions
|
@ -36,8 +36,8 @@ impl Termination for MainExit {
|
|||
}
|
||||
|
||||
impl MainExit {
|
||||
pub fn new(res: Result<()>, done: Duration) -> Self {
|
||||
res.map(|()| MainExit::Success(Some(done)))
|
||||
pub fn new(res: Result<()>, done: Option<Duration>) -> Self {
|
||||
res.map(|()| MainExit::Success(done))
|
||||
.unwrap_or_else(|err| {
|
||||
err.downcast::<BinstallError>()
|
||||
.map(MainExit::Error)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue