diff --git a/crates/typst-cli/src/main.rs b/crates/typst-cli/src/main.rs index c7221f775..5e1ef47c9 100644 --- a/crates/typst-cli/src/main.rs +++ b/crates/typst-cli/src/main.rs @@ -50,7 +50,7 @@ fn main() -> ExitCode { .leave_alternate_screen() .map_err(|err| eco_format!("failed to leave alternate screen ({err})")); - if let Err(msg) = res.or(res_leave) { + if let Some(msg) = res.err().or(res_leave.err()) { set_failed(); print_error(&msg).expect("failed to print error"); }