Skip to content

Commit

Permalink
Merge pull request #820 from yizhao1998/main
Browse files Browse the repository at this point in the history
Update ch06-01-defining-an-enum.md
  • Loading branch information
KaiserY authored Oct 4, 2024
2 parents 7261c9d + 7448984 commit e675c74
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ch06-01-defining-an-enum.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
{{#rustdoc_include ../listings/ch06-enums-and-pattern-matching/no-listing-01-defining-enums/src/main.rs:instance}}
```

注意枚举的成员位于其标识符的命名空间中,并使用两个冒号分开。这么设计的益处是现在 `IpAddrKind::V4``IpAddrKind::V6` 都是 `IpAddrKind` 类型的。例如,接着可以定义一个函数来获取任何 `IpAddrKind`
注意枚举的成员位于其标识符的命名空间中,并使用两个冒号分开。这么设计的益处是现在 `IpAddrKind::V4``IpAddrKind::V6` 都是 `IpAddrKind` 类型的。例如,接着可以定义一个函数来接收任何 `IpAddrKind`类型的参数

```rust
{{#rustdoc_include ../listings/ch06-enums-and-pattern-matching/no-listing-01-defining-enums/src/main.rs:fn}}
Expand Down

0 comments on commit e675c74

Please sign in to comment.