Skip to content

Commit

Permalink
nit: use let-else
Browse files Browse the repository at this point in the history
  • Loading branch information
jimblandy committed Dec 7, 2024
1 parent 5d88eda commit fe3c399
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions naga/src/front/spv/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4256,13 +4256,9 @@ impl<I: Iterator<Item = u32>> Frontend<I> {
// We know from the SPIR-V spec that the result type must be an integer
// scalar, and we'll need the type itself to get a handle to the atomic
// result struct.
let scalar = if let crate::TypeInner::Scalar(s) =
ctx.type_arena[p_base_ty_h].inner
{
Ok(s)
} else {
Err(crate::front::atomic_upgrade::Error::CompareExchangeNonScalarBaseType)
}?;
let crate::TypeInner::Scalar(scalar) = ctx.type_arena[p_base_ty_h].inner else {
return Err(crate::front::atomic_upgrade::Error::CompareExchangeNonScalarBaseType.into());
};

// Get the handle the atomic result, which is the
// result struct __atomic_compare_exchange_result<T>
Expand Down

0 comments on commit fe3c399

Please sign in to comment.