authorgravatar for 72133097+gettsu@users.noreply.github.comgettsu <72133097+gettsu@users.noreply.github.com> 2022-12-13 13:49:42+09:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2022-12-12 23:49:42-05:00
log175d018512c6fd04833a242413ff21e9551b23a2
tree34cf6bd9ea26abee42e8bb1fdcbeb604d0304b4f
parent25d3713b07a100d8fdb349317db97fd9d0c1e366
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

langref: avoid use of the term "enum variant" in enums.zig (#13847)


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

doc/langref.html.in+3-3
...@@ -3585,7 +3585,7 @@ const Type = enum {...@@ -3585,7 +3585,7 @@ const Type = enum {
3585 not_ok,3585 not_ok,
3586};3586};
35873587
3588// Declare a specific instance of the enum variant.3588// Declare a specific enum field.
3589const c = Type.ok;3589const c = Type.ok;
35903590
3591// If you want access to the ordinal value of an enum, you3591// If you want access to the ordinal value of an enum, you
...@@ -3634,13 +3634,13 @@ test "enum method" {...@@ -3634,13 +3634,13 @@ test "enum method" {
3634 try expect(!p.isClubs());3634 try expect(!p.isClubs());
3635}3635}
36363636
3637// An enum variant of different types can be switched upon.3637// An enum can be switched upon.
3638const Foo = enum {3638const Foo = enum {
3639 string,3639 string,
3640 number,3640 number,
3641 none,3641 none,
3642};3642};
3643test "enum variant switch" {3643test "enum switch" {
3644 const p = Foo.number;3644 const p = Foo.number;
3645 const what_is_it = switch (p) {3645 const what_is_it = switch (p) {
3646 Foo.string => "this is a string",3646 Foo.string => "this is a string",