File tree Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change 1
- % Slice patterns
1
+ % スライスパターン
2
+ <!-- % Slice patterns -->
2
3
3
- If you want to match against a slice or array, you can use ` & ` with the
4
- ` slice_patterns ` feature:
4
+ <!-- If you want to match against a slice or array, you can use `&` with the -->
5
+ <!-- `slice_patterns` feature: -->
6
+ スライスや配列に対してマッチを行いたい場合、 ` slice_patterns ` フィーチャを有効にすると以下のように ` & ` を使うことができます。
5
7
6
8
``` rust
7
9
#![feature(slice_patterns)]
@@ -16,10 +18,11 @@ fn main() {
16
18
}
17
19
```
18
20
19
- The ` advanced_slice_patterns ` gate lets you use ` .. ` to indicate any number of
20
- elements inside a pattern matching a slice. This wildcard can only be used once
21
- for a given array. If there's an identifier before the ` .. ` , the result of the
22
- slice will be bound to that name. For example:
21
+ <!-- The `advanced_slice_patterns` gate lets you use `..` to indicate any number of -->
22
+ <!-- elements inside a pattern matching a slice. This wildcard can only be used once -->
23
+ <!-- for a given array. If there's an identifier before the `..`, the result of the -->
24
+ <!-- slice will be bound to that name. For example: -->
25
+ ` advanced_slice_patterns ` フィーチャを有効にすると、スライスにマッチするパターンの中で ` .. ` を使ってその要素の数が任意であることを示すことができます。このワイルドカードは与えるパターン配列の中で一度だけ使うことができます。もし ` .. ` の前に識別子(訳注: 以下の例では ` inside ` )があれば、そのスライスの結果はその識別子名に束縛されます。例えば以下のようになります。
23
26
24
27
``` rust
25
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 | ミュータブル
59
62
| trait | トレイト
60
63
| unsized type | サイズ不定型
61
64
| vector | vector
65
+ | wildcard | ワイルドカード
You can’t perform that action at this time.
0 commit comments