This commit is contained in:
Josh Thomas 2025-05-14 14:34:26 -05:00
parent f4fc4f85ac
commit 3d77cf9991
2 changed files with 4 additions and 2 deletions

View file

@ -107,7 +107,8 @@ impl Token {
}
pub fn start(&self) -> Option<u32> {
self.start.map(|s| u32::try_from(s).expect("Start position should fit in u32"))
self.start
.map(|s| u32::try_from(s).expect("Start position should fit in u32"))
}
pub fn length(&self) -> u32 {

View file

@ -1,3 +1,5 @@
use std::fmt::Write;
use anyhow::Result;
use clap::Parser;
@ -33,7 +35,6 @@ pub fn run(args: Vec<String>) -> Result<()> {
Err(e) => {
let mut msg = e.to_string();
if let Some(source) = e.source() {
use std::fmt::Write;
let _ = write!(msg, ", caused by {source}");
}
Exit::error().with_message(msg).process_exit()