Use debug.assert instead of testing.expect.

`testing.expect` and friends are intended to be used only in tests; this change reflects that intention.
This commit is contained in:
InKryption
2021-10-28 17:16:03 +01:00
committed by Veikka Tuominen
parent ee038df7e2
commit eeb8629bea

View File

@@ -648,7 +648,7 @@ const TagPayloadType = TagPayload;
///Given a tagged union type, and an enum, return the type of the union
/// field corresponding to the enum tag.
pub fn TagPayload(comptime U: type, tag: Tag(U)) type {
try testing.expect(trait.is(.Union)(U));
comptime debug.assert(trait.is(.Union)(U));
const info = @typeInfo(U).Union;