Skip to content

Commit

Permalink
Fix unwrap in error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
NiseVoid committed Jun 2, 2024
1 parent 7031ca1 commit 883a600
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/compose/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ impl ComposerError {
.map(|(span, desc)| {
trace!(
"mapping span {:?} -> {:?}",
span.to_range().unwrap(),
span.to_range().unwrap_or(0..0),
map_span(span.to_range().unwrap_or(0..0))
);
Label::primary((), map_span(span.to_range().unwrap_or(0..0)))
Expand All @@ -219,7 +219,8 @@ impl ComposerError {
ComposerErrorInner::WgslParseError(e) => (
e.labels()
.map(|(range, msg)| {
Label::primary((), map_span(range.to_range().unwrap())).with_message(msg)
Label::primary((), map_span(range.to_range().unwrap_or(0..0)))
.with_message(msg)
})
.collect(),
vec![e.message().to_owned()],
Expand Down

0 comments on commit 883a600

Please sign in to comment.