Skip to content

Commit 40c8179

Browse files
committed
ci: generate pages at 219647c [ci skip]
1 parent 219647c commit 40c8179

File tree

4 files changed

+34
-34
lines changed

4 files changed

+34
-34
lines changed

docs/ch18-03-pattern-syntax.html

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -311,15 +311,15 @@ <h3 id="複数のパターン"><a class="header" href="#複数のパターン">
311311
-->
312312
<p>このコードは、<code>one or two</code>を出力します。</p>
313313
<!--
314-
### Matching Ranges of Values with `...`
314+
### Matching Ranges of Values with `..=`
315315
-->
316-
<h3 id="で値の範囲に合致させる"><a class="header" href="#で値の範囲に合致させる"><code>...</code>で値の範囲に合致させる</a></h3>
316+
<h3 id="で値の範囲に合致させる"><a class="header" href="#で値の範囲に合致させる"><code>..=</code>で値の範囲に合致させる</a></h3>
317317
<!--
318-
The `...` syntax allows us to match to an inclusive range of values. In the
318+
The `..=` syntax allows us to match to an inclusive range of values. In the
319319
following code, when a pattern matches any of the values within the range, that
320320
arm will execute:
321321
-->
322-
<p><code>...</code>記法により、限度値を含む値の範囲にマッチさせることができます。以下のコードでは、
322+
<p><code>..=</code>記法により、限度値を含む値の範囲にマッチさせることができます。以下のコードでは、
323323
パターンが範囲内のどれかの値に合致すると、そのアームが実行されます:</p>
324324
<pre><pre class="playground"><code class="language-rust">
325325
<span class="boring">#![allow(unused)]
@@ -328,21 +328,21 @@ <h3 id="で値の範囲に合致させる"><a class="header" href="#で値の範
328328

329329
match x {
330330
// 1から5まで
331-
1 ... 5 =&gt; println!(&quot;one through five&quot;),
331+
1..=5 =&gt; println!(&quot;one through five&quot;),
332332
// それ以外
333333
_ =&gt; println!(&quot;something else&quot;),
334334
}
335335
<span class="boring">}
336336
</span></code></pre></pre>
337337
<!--
338338
If `x` is 1, 2, 3, 4, or 5, the first arm will match. This syntax is more
339-
convenient than using the `|` operator to express the same idea; instead of `1
340-
... 5`, we would have to specify `1 | 2 | 3 | 4 | 5` if we used `|`. Specifying
339+
convenient than using the `|` operator to express the same idea; instead of `1..=5`,
340+
we would have to specify `1 | 2 | 3 | 4 | 5` if we used `|`. Specifying
341341
a range is much shorter, especially if we want to match, say, any number
342342
between 1 and 1,000!
343343
-->
344344
<p><code>x</code>が1、2、3、4か5なら、最初のアームが合致します。この記法は、<code>|</code>演算子を使用して同じ考えを表現するより便利です;
345-
<code>1 ... 5</code>ではなく、<code>|</code>を使用したら、<code>1 | 2 | 3 | 4 | 5</code>と指定しなければならないでしょう。
345+
<code>1..=5</code>ではなく、<code>|</code>を使用したら、<code>1 | 2 | 3 | 4 | 5</code>と指定しなければならないでしょう。
346346
範囲を指定する方が遥かに短いのです。特に1から1000までの値と合致させたいとかなら!</p>
347347
<!--
348348
Ranges are only allowed with numeric values or `char` values, because the
@@ -362,9 +362,9 @@ <h3 id="で値の範囲に合致させる"><a class="header" href="#で値の範
362362

363363
match x {
364364
// ASCII文字前半
365-
'a' ... 'j' =&gt; println!(&quot;early ASCII letter&quot;),
365+
'a'..='j' =&gt; println!(&quot;early ASCII letter&quot;),
366366
// ASCII文字後半
367-
'k' ... 'z' =&gt; println!(&quot;late ASCII letter&quot;),
367+
'k'..='z' =&gt; println!(&quot;late ASCII letter&quot;),
368368
// それ以外
369369
_ =&gt; println!(&quot;something else&quot;),
370370
}
@@ -1429,13 +1429,13 @@ <h3 id="束縛"><a class="header" href="#束縛"><code>@</code>束縛</a></h3>
14291429
The *at* operator (`@`) lets us create a variable that holds a value at the
14301430
same time we’re testing that value to see whether it matches a pattern. Listing
14311431
18-32 shows an example where we want to test that a `Message::Hello` `id` field
1432-
is within the range `3...7`. But we also want to bind the value to the variable
1432+
is within the range `3..=7`. But we also want to bind the value to the variable
14331433
`id_variable` so we can use it in the code associated with the arm. We could
14341434
name this variable `id`, the same as the field, but for this example we’ll use
14351435
a different name.
14361436
-->
14371437
<p><em>at</em>演算子(<code>@</code>)により、値を保持する変数を生成するのと同時にその値がパターンに一致するかを調べることができます。
1438-
リスト18-32は、<code>Message::Hello</code><code>id</code>フィールドが範囲<code>3...7</code>にあるかを確かめたいという例です。
1438+
リスト18-32は、<code>Message::Hello</code><code>id</code>フィールドが範囲<code>3..=7</code>にあるかを確かめたいという例です。
14391439
しかし、アームに紐づいたコードで使用できるように変数<code>id_variable</code>に値を束縛もしたいです。この変数をフィールドと同じ、
14401440
<code>id</code>と名付けることもできますが、この例では異なる名前にします。</p>
14411441
<pre><pre class="playground"><code class="language-rust">
@@ -1448,11 +1448,11 @@ <h3 id="束縛"><a class="header" href="#束縛"><code>@</code>束縛</a></h3>
14481448
let msg = Message::Hello { id: 5 };
14491449

14501450
match msg {
1451-
Message::Hello { id: id_variable @ 3...7 } =&gt; {
1451+
Message::Hello { id: id_variable @ 3..=7 } =&gt; {
14521452
// 範囲内のidが見つかりました: {}
14531453
println!(&quot;Found an id in range: {}&quot;, id_variable)
14541454
},
1455-
Message::Hello { id: 10...12 } =&gt; {
1455+
Message::Hello { id: 10..=12 } =&gt; {
14561456
// 別の範囲内のidが見つかりました
14571457
println!(&quot;Found an id in another range&quot;)
14581458
},
@@ -1470,10 +1470,10 @@ <h3 id="束縛"><a class="header" href="#束縛"><code>@</code>束縛</a></h3>
14701470
<p><span class="caption"><code>@</code>を使用してテストしつつ、パターンの値に束縛する</span></p>
14711471
<!--
14721472
This example will print `Found an id in range: 5`. By specifying `id_variable
1473-
@` before the range `3...7`, we’re capturing whatever value matched the range
1473+
@` before the range `3..=7`, we’re capturing whatever value matched the range
14741474
while also testing that the value matched the range pattern.
14751475
-->
1476-
<p>この例は、<code>Found an id in range: 5</code>と出力します。範囲<code>3...7</code>の前に<code>id_variable @</code>と指定することで、
1476+
<p>この例は、<code>Found an id in range: 5</code>と出力します。範囲<code>3..=7</code>の前に<code>id_variable @</code>と指定することで、
14771477
値が範囲パターンに一致することを確認しつつ、範囲にマッチしたどんな値も捕捉しています。</p>
14781478
<!--
14791479
In the second arm, where we only have a range specified in the pattern, the code

docs/print.html

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34767,15 +34767,15 @@ <h3 id="複数のパターン"><a class="header" href="#複数のパターン">
3476734767
-->
3476834768
<p>このコードは、<code>one or two</code>を出力します。</p>
3476934769
<!--
34770-
### Matching Ranges of Values with `...`
34770+
### Matching Ranges of Values with `..=`
3477134771
-->
34772-
<h3 id="で値の範囲に合致させる"><a class="header" href="#で値の範囲に合致させる"><code>...</code>で値の範囲に合致させる</a></h3>
34772+
<h3 id="で値の範囲に合致させる"><a class="header" href="#で値の範囲に合致させる"><code>..=</code>で値の範囲に合致させる</a></h3>
3477334773
<!--
34774-
The `...` syntax allows us to match to an inclusive range of values. In the
34774+
The `..=` syntax allows us to match to an inclusive range of values. In the
3477534775
following code, when a pattern matches any of the values within the range, that
3477634776
arm will execute:
3477734777
-->
34778-
<p><code>...</code>記法により、限度値を含む値の範囲にマッチさせることができます。以下のコードでは、
34778+
<p><code>..=</code>記法により、限度値を含む値の範囲にマッチさせることができます。以下のコードでは、
3477934779
パターンが範囲内のどれかの値に合致すると、そのアームが実行されます:</p>
3478034780
<pre><pre class="playground"><code class="language-rust">
3478134781
<span class="boring">#![allow(unused)]
@@ -34784,21 +34784,21 @@ <h3 id="で値の範囲に合致させる"><a class="header" href="#で値の範
3478434784

3478534785
match x {
3478634786
// 1から5まで
34787-
1 ... 5 =&gt; println!(&quot;one through five&quot;),
34787+
1..=5 =&gt; println!(&quot;one through five&quot;),
3478834788
// それ以外
3478934789
_ =&gt; println!(&quot;something else&quot;),
3479034790
}
3479134791
<span class="boring">}
3479234792
</span></code></pre></pre>
3479334793
<!--
3479434794
If `x` is 1, 2, 3, 4, or 5, the first arm will match. This syntax is more
34795-
convenient than using the `|` operator to express the same idea; instead of `1
34796-
... 5`, we would have to specify `1 | 2 | 3 | 4 | 5` if we used `|`. Specifying
34795+
convenient than using the `|` operator to express the same idea; instead of `1..=5`,
34796+
we would have to specify `1 | 2 | 3 | 4 | 5` if we used `|`. Specifying
3479734797
a range is much shorter, especially if we want to match, say, any number
3479834798
between 1 and 1,000!
3479934799
-->
3480034800
<p><code>x</code>が1、2、3、4か5なら、最初のアームが合致します。この記法は、<code>|</code>演算子を使用して同じ考えを表現するより便利です;
34801-
<code>1 ... 5</code>ではなく、<code>|</code>を使用したら、<code>1 | 2 | 3 | 4 | 5</code>と指定しなければならないでしょう。
34801+
<code>1..=5</code>ではなく、<code>|</code>を使用したら、<code>1 | 2 | 3 | 4 | 5</code>と指定しなければならないでしょう。
3480234802
範囲を指定する方が遥かに短いのです。特に1から1000までの値と合致させたいとかなら!</p>
3480334803
<!--
3480434804
Ranges are only allowed with numeric values or `char` values, because the
@@ -34818,9 +34818,9 @@ <h3 id="で値の範囲に合致させる"><a class="header" href="#で値の範
3481834818

3481934819
match x {
3482034820
// ASCII文字前半
34821-
'a' ... 'j' =&gt; println!(&quot;early ASCII letter&quot;),
34821+
'a'..='j' =&gt; println!(&quot;early ASCII letter&quot;),
3482234822
// ASCII文字後半
34823-
'k' ... 'z' =&gt; println!(&quot;late ASCII letter&quot;),
34823+
'k'..='z' =&gt; println!(&quot;late ASCII letter&quot;),
3482434824
// それ以外
3482534825
_ =&gt; println!(&quot;something else&quot;),
3482634826
}
@@ -35885,13 +35885,13 @@ <h3 id="束縛"><a class="header" href="#束縛"><code>@</code>束縛</a></h3>
3588535885
The *at* operator (`@`) lets us create a variable that holds a value at the
3588635886
same time we’re testing that value to see whether it matches a pattern. Listing
3588735887
18-32 shows an example where we want to test that a `Message::Hello` `id` field
35888-
is within the range `3...7`. But we also want to bind the value to the variable
35888+
is within the range `3..=7`. But we also want to bind the value to the variable
3588935889
`id_variable` so we can use it in the code associated with the arm. We could
3589035890
name this variable `id`, the same as the field, but for this example we’ll use
3589135891
a different name.
3589235892
-->
3589335893
<p><em>at</em>演算子(<code>@</code>)により、値を保持する変数を生成するのと同時にその値がパターンに一致するかを調べることができます。
35894-
リスト18-32は、<code>Message::Hello</code>の<code>id</code>フィールドが範囲<code>3...7</code>にあるかを確かめたいという例です。
35894+
リスト18-32は、<code>Message::Hello</code>の<code>id</code>フィールドが範囲<code>3..=7</code>にあるかを確かめたいという例です。
3589535895
しかし、アームに紐づいたコードで使用できるように変数<code>id_variable</code>に値を束縛もしたいです。この変数をフィールドと同じ、
3589635896
<code>id</code>と名付けることもできますが、この例では異なる名前にします。</p>
3589735897
<pre><pre class="playground"><code class="language-rust">
@@ -35904,11 +35904,11 @@ <h3 id="束縛"><a class="header" href="#束縛"><code>@</code>束縛</a></h3>
3590435904
let msg = Message::Hello { id: 5 };
3590535905

3590635906
match msg {
35907-
Message::Hello { id: id_variable @ 3...7 } =&gt; {
35907+
Message::Hello { id: id_variable @ 3..=7 } =&gt; {
3590835908
// 範囲内のidが見つかりました: {}
3590935909
println!(&quot;Found an id in range: {}&quot;, id_variable)
3591035910
},
35911-
Message::Hello { id: 10...12 } =&gt; {
35911+
Message::Hello { id: 10..=12 } =&gt; {
3591235912
// 別の範囲内のidが見つかりました
3591335913
println!(&quot;Found an id in another range&quot;)
3591435914
},
@@ -35926,10 +35926,10 @@ <h3 id="束縛"><a class="header" href="#束縛"><code>@</code>束縛</a></h3>
3592635926
<p><span class="caption"><code>@</code>を使用してテストしつつ、パターンの値に束縛する</span></p>
3592735927
<!--
3592835928
This example will print `Found an id in range: 5`. By specifying `id_variable
35929-
@` before the range `3...7`, we’re capturing whatever value matched the range
35929+
@` before the range `3..=7`, we’re capturing whatever value matched the range
3593035930
while also testing that the value matched the range pattern.
3593135931
-->
35932-
<p>この例は、<code>Found an id in range: 5</code>と出力します。範囲<code>3...7</code>の前に<code>id_variable @</code>と指定することで、
35932+
<p>この例は、<code>Found an id in range: 5</code>と出力します。範囲<code>3..=7</code>の前に<code>id_variable @</code>と指定することで、
3593335933
値が範囲パターンに一致することを確認しつつ、範囲にマッチしたどんな値も捕捉しています。</p>
3593435934
<!--
3593535935
In the second arm, where we only have a range specified in the pattern, the code

docs/searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/searchindex.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)