Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(ast): use exhaustive match for
Argument
to `ArrayExpressio…
…nElement` conversion (#7848) Follow-on after #7830. Refactor. Use an exhaustive match in implementation of `From<Argument<'a>> for ArrayExpressionElement<'a>`. At present this change makes no difference. But the reason I feel an exhaustive match is preferable here is that if we add a variant to `Argument` enum later, then this match will be missing an arm to handle that variant, and compiler will refuse to compile until we deal with it. Whereas before this PR, compiler would not complain, but instead it'd be a runtime panic when `into_expression` discovers that the new `Argument` variant is not an `Expression`.
- Loading branch information