File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 3
3
4
4
<!-- If you want to match against a slice or array, you can use `&` with the -->
5
5
<!-- `slice_patterns` feature: -->
6
- スライスや配列に対してマッチを行いたい場合、 ` slice_patterns ` フィーチャを有効にし ` & ` を使うことができます。
6
+ スライスや配列に対してマッチを行いたい場合、 ` slice_patterns ` フィーチャを有効にすると以下のように ` & ` を使うことができます。
7
7
8
8
``` rust
9
9
#![feature(slice_patterns)]
@@ -22,7 +22,7 @@ fn main() {
22
22
<!-- elements inside a pattern matching a slice. This wildcard can only be used once -->
23
23
<!-- for a given array. If there's an identifier before the `..`, the result of the -->
24
24
<!-- slice will be bound to that name. For example: -->
25
- ` advanced_slice_patterns ` フィーチャを使うと、 ` .. ` によってスライスにマッチするパターンの中で任意数の要素を示すことができます。このワイルドカードは与えられるパターン配列の中で一度だけ使うことができます 。もし ` .. ` の前に識別子(訳注: 以下の例では ` inside ` )があれば、そのスライスの結果はその識別子名に束縛されます。例えば以下のようになります。
25
+ ` advanced_slice_patterns ` フィーチャを有効にすると、スライスにマッチするパターンの中で ` .. ` を使ってその要素の数が任意であることを示すことができます。このワイルドカードは与えるパターン配列の中で一度だけ使うことができます 。もし ` .. ` の前に識別子(訳注: 以下の例では ` inside ` )があれば、そのスライスの結果はその識別子名に束縛されます。例えば以下のようになります。
26
26
27
27
``` rust
28
28
#![feature(advanced_slice_patterns, slice_patterns)]
Original file line number Diff line number Diff line change 14
14
| allocator | アロケータ
15
15
| application | アプリケーション
16
16
| arity | アリティ
17
+ | array | 配列
17
18
| associated - | 関連-
18
19
| attribute | アトリビュート
19
20
| binary | バイナリ
35
36
| expression statement | 式文
36
37
| feature | フィーチャ
37
38
| generics | ジェネリクス
39
+ | identifier | 識別子
38
40
| immutable | イミュータブル
39
41
| Intrinsics | Intrinsic
40
42
| Lang Items | Lang Item
41
43
| library | ライブラリ
42
44
| lifetime | ライフタイム
43
45
| link | リンク
46
+ | match | マッチ
44
47
| memory | メモリ
45
48
| move | ムーブ
46
49
| mutable | ミュータブル
You can’t perform that action at this time.
0 commit comments