diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-06-12 16:43:49 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-06-12 16:47:46 +0200 |
| commit | d3b4d7da9a801dac3af6a3cf52eb55af83adc5f5 (patch) | |
| tree | 72ab79ed75dddfb7b97ddf02ba4d19c4efc9ea5a /cli | |
| parent | 378ebe5f5601f11c3f428c17bed492012feb251e (diff) | |
More `bail!` usage
Diffstat (limited to 'cli')
| -rw-r--r-- | cli/src/main.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cli/src/main.rs b/cli/src/main.rs index 7ecf3461..f8affa0d 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -21,7 +21,7 @@ use same_file::{is_same_file, Handle}; use siphasher::sip128::{Hasher128, SipHasher13}; use std::cell::OnceCell; use termcolor::{ColorChoice, StandardStream, WriteColor}; -use typst::diag::{FileError, FileResult, SourceError, StrResult}; +use typst::diag::{bail, FileError, FileResult, SourceError, StrResult}; use typst::doc::Document; use typst::eval::{Datetime, Library}; use typst::font::{Font, FontBook, FontInfo, FontVariant}; @@ -314,7 +314,7 @@ fn export(document: &Document, command: &CompileSettings) -> StrResult<()> { let string = command.output.to_str().unwrap_or_default(); let numbered = string.contains("{n}"); if !numbered && document.pages.len() > 1 { - Err("cannot export multiple PNGs without `{n}` in output path")?; + bail!("cannot export multiple PNGs without `{{n}}` in output path"); } // Find a number width that accommodates all pages. For instance, the |
