Skip to content

Commit

Permalink
Merge pull request #189 from kdnakt/fix-guard
Browse files Browse the repository at this point in the history
Translate untranslated lines in guard.md
  • Loading branch information
dalance authored Jul 16, 2024
2 parents 152b95a + 305c4f8 commit 4539dfc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/flow_control/match/guard.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,14 @@ fn main() {
}
```

<!--
Note that the compiler won't take guard conditions into account when checking
if all patterns are covered by the match expression.
possible conditions have been checked. Therefore, you must use the `_` pattern
at the end.
-->
コンパイラは、match式ですべてのパターンがカバーされているかどうかを調べるときに、
ガード条件を考慮しない点に注意してください。

```rust,editable,ignore,mdbook-runnable
```rust,editable
fn main() {
let number: u8 = 4;
Expand All @@ -47,7 +48,7 @@ fn main() {
i if i > 0 => println!("Greater than zero"),
// _ => unreachable!("Should never happen."),
// TODO ^ uncomment to fix compilation
_ => println!("Fell through"), // This should not be possible to reach
// TODO ^ アンコメントしてコンパイルを修正しよう
}
}
```
Expand Down

0 comments on commit 4539dfc

Please sign in to comment.