authorgravatar for 59504965+InKryption@users.noreply.github.comInKryption <59504965+InKryption@users.noreply.github.com> 2021-10-28 17:16:03+01:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2021-10-29 20:01:59+00:00
logeeb8629bea90b931a65559886c272fe7aad9211d
tree9cc7255eff59fd1e3564dcb483797244d49fbe34
parentee038df7e2782d336e8d7cdb8619c39d85c027bb

Use `debug.assert` instead of `testing.expect`.

`testing.expect` and friends are intended to be used only in tests; this change reflects that intention.

1 files changed, 1 insertions(+), 1 deletions(-)

lib/std/meta.zig+1-1
...@@ -648,7 +648,7 @@ const TagPayloadType = TagPayload;...@@ -648,7 +648,7 @@ const TagPayloadType = TagPayload;
648///Given a tagged union type, and an enum, return the type of the union648///Given a tagged union type, and an enum, return the type of the union
649/// field corresponding to the enum tag.649/// field corresponding to the enum tag.
650pub fn TagPayload(comptime U: type, tag: Tag(U)) type {650pub fn TagPayload(comptime U: type, tag: Tag(U)) type {
651 try testing.expect(trait.is(.Union)(U));651 comptime debug.assert(trait.is(.Union)(U));
652652
653 const info = @typeInfo(U).Union;653 const info = @typeInfo(U).Union;
654654