Skip to content

Commit 6f0e270

Browse files
authored
Merge pull request #136 from kdnakt/translate-binding
Translate untranslated lines in binding.md
2 parents 8b44bdc + 6a75e70 commit 6f0e270

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/flow_control/match/binding.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ fn main() {
3737
}
3838
```
3939

40+
<!--
4041
You can also use binding to "destructure" `enum` variants, such as `Option`:
42+
-->
43+
`Option`のような、`enum`の値をデストラクトするためにも、バインディングを利用できます。
4144

4245
```rust,editable
4346
fn some_number() -> Option<u32> {
@@ -48,10 +51,13 @@ fn main() {
4851
match some_number() {
4952
// Got `Some` variant, match if its value, bound to `n`,
5053
// is equal to 42.
54+
// `n`にバインドされた`Some`の値が42に等しいときにマッチ。
5155
Some(n @ 42) => println!("The Answer: {}!", n),
5256
// Match any other number.
57+
// それ以外の数値にマッチ。
5358
Some(n) => println!("Not interesting... {}", n),
5459
// Match anything else (`None` variant).
60+
// それ以外にマッチ(`None`の値)。
5561
_ => (),
5662
}
5763
}

0 commit comments

Comments
 (0)