Skip to content

Commit

Permalink
chore: remove unwrap call in favor of an explicit error message.
Browse files Browse the repository at this point in the history
  • Loading branch information
peterhuene committed Oct 16, 2024
1 parent 2961b65 commit 6f5e901
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/commands/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,13 @@ pub fn format(args: FormatArgs) -> Result<()> {
);
}

let document = Node::Ast(document.ast().into_v1().unwrap()).into_format_element();
let document = Node::Ast(
document
.ast()
.into_v1()
.ok_or_else(|| anyhow!("only WDL 1.x documents are currently supported"))?,
)
.into_format_element();
let config = Builder::default()
.indent(if args.with_tabs {
Indent::Tabs(NonZeroUsize::new(1).unwrap())
Expand Down

0 comments on commit 6f5e901

Please sign in to comment.