Skip to content

Commit 8f064e9

Browse files
committed
ci: generate pages at 4d5e41b [ci skip]
1 parent 4d5e41b commit 8f064e9

File tree

5 files changed

+28
-4
lines changed

5 files changed

+28
-4
lines changed

docs/generics.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ <h1 id="ジェネリクス"><a class="header" href="#ジェネリクス">ジェ
158158
is for type parameters.
159159
-->
160160
<p>ジェネリクスとは、型と関数の機能をより汎用的に使えるようにするための機能です。これはあらゆる局面でコードの重複を避けるために非常に役立ちますが、多少構文が複雑になります。すなわち、ジェネリック型を使いこなすには、どのようなジェネリック型がきちんと機能するかに細心の注意を払う必要があります。
161-
The simplest and most common use of generics is for type parameters.</p>
161+
最もシンプルで一般的なジェネリクスの利用法は型パラメータです。</p>
162162
<!--
163163
A type parameter is specified as generic by the use of angle brackets and upper
164164
[camel case][camelcase]: `<Aaa, Bbb, ...>`. "Generic type parameters" are

docs/print.html

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2280,8 +2280,11 @@ <h1 id="型キャスト"><a class="header" href="#型キャスト">型キャス
22802280

22812281
// Error! There are limitations in conversion rules.
22822282
// A float cannot be directly converted to a char.
2283+
// エラー! 変換ルールには制限があります。
2284+
// 浮動小数点数を文字に直接変換することはできません。
22832285
let character = decimal as char;
22842286
// FIXME ^ Comment out this line
2287+
// FIXME ^ この行をコメントアウトしましょう。
22852288

22862289
println!(&quot;Casting: {} -&gt; {} -&gt; {}&quot;, decimal, integer, character);
22872290

@@ -2304,6 +2307,7 @@ <h1 id="型キャスト"><a class="header" href="#型キャスト">型キャス
23042307
println!(&quot; -1 as a u8 is : {}&quot;, (-1i8) as u8);
23052308

23062309
// For positive numbers, this is the same as the modulus
2310+
// 正の数では、これは剰余と同じです。
23072311
println!(&quot;1000 mod 256 is : {}&quot;, 1000 % 256);
23082312

23092313
// When casting to a signed type, the (bitwise) result is the same as
@@ -2314,6 +2318,7 @@ <h1 id="型キャスト"><a class="header" href="#型キャスト">型キャス
23142318
// 2. 2の補数(two's complement)をとる
23152319

23162320
// Unless it already fits, of course.
2321+
// すでに収まっている場合はそのままです。
23172322
println!(&quot; 128 as a i16 is: {}&quot;, 128 as i16);
23182323

23192324
// 128 as u8 -&gt; 128, whose value in 8-bit two's complement representation is:
@@ -2332,6 +2337,10 @@ <h1 id="型キャスト"><a class="header" href="#型キャスト">型キャス
23322337
// when casting from float to int. If the floating point value exceeds
23332338
// the upper bound or is less than the lower bound, the returned value
23342339
// will be equal to the bound crossed.
2340+
// Rust 1.45以降、浮動小数点数を整数にキャストするとき、
2341+
// `as`キーワードが *飽和的キャスト* を行います。
2342+
// 浮動小数点数の値が上限を超えたり下限を下回ったりする場合は、
2343+
// 戻り値は越えられた境界の値となります。
23352344

23362345
// 300.0 as u8 is 255
23372346
println!(&quot; 300.0 as u8 is : {}&quot;, 300.0_f32 as u8);
@@ -2343,6 +2352,9 @@ <h1 id="型キャスト"><a class="header" href="#型キャスト">型キャス
23432352
// This behavior incurs a small runtime cost and can be avoided
23442353
// with unsafe methods, however the results might overflow and
23452354
// return **unsound values**. Use these methods wisely:
2355+
// この挙動は実行時にややコストがかかるため、安全でない方法で回避できます。
2356+
// ただし、結果はオーバーフローしたり *不正確な値* を返す場合があります。
2357+
// この方法は賢く使いましょう:
23462358
unsafe {
23472359
// 300.0 as u8 is 44
23482360
println!(&quot; 300.0 as u8 is : {}&quot;, 300.0_f32.to_int_unchecked::&lt;u8&gt;());
@@ -6018,7 +6030,7 @@ <h1 id="ジェネリクス"><a class="header" href="#ジェネリクス">ジェ
60186030
is for type parameters.
60196031
-->
60206032
<p>ジェネリクスとは、型と関数の機能をより汎用的に使えるようにするための機能です。これはあらゆる局面でコードの重複を避けるために非常に役立ちますが、多少構文が複雑になります。すなわち、ジェネリック型を使いこなすには、どのようなジェネリック型がきちんと機能するかに細心の注意を払う必要があります。
6021-
The simplest and most common use of generics is for type parameters.</p>
6033+
最もシンプルで一般的なジェネリクスの利用法は型パラメータです。</p>
60226034
<!--
60236035
A type parameter is specified as generic by the use of angle brackets and upper
60246036
[camel case][camelcase]: `<Aaa, Bbb, ...>`. "Generic type parameters" are

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.

docs/types/cast.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,11 @@ <h1 id="型キャスト"><a class="header" href="#型キャスト">型キャス
181181

182182
// Error! There are limitations in conversion rules.
183183
// A float cannot be directly converted to a char.
184+
// エラー! 変換ルールには制限があります。
185+
// 浮動小数点数を文字に直接変換することはできません。
184186
let character = decimal as char;
185187
// FIXME ^ Comment out this line
188+
// FIXME ^ この行をコメントアウトしましょう。
186189

187190
println!(&quot;Casting: {} -&gt; {} -&gt; {}&quot;, decimal, integer, character);
188191

@@ -205,6 +208,7 @@ <h1 id="型キャスト"><a class="header" href="#型キャスト">型キャス
205208
println!(&quot; -1 as a u8 is : {}&quot;, (-1i8) as u8);
206209

207210
// For positive numbers, this is the same as the modulus
211+
// 正の数では、これは剰余と同じです。
208212
println!(&quot;1000 mod 256 is : {}&quot;, 1000 % 256);
209213

210214
// When casting to a signed type, the (bitwise) result is the same as
@@ -215,6 +219,7 @@ <h1 id="型キャスト"><a class="header" href="#型キャスト">型キャス
215219
// 2. 2の補数(two's complement)をとる
216220

217221
// Unless it already fits, of course.
222+
// すでに収まっている場合はそのままです。
218223
println!(&quot; 128 as a i16 is: {}&quot;, 128 as i16);
219224

220225
// 128 as u8 -&gt; 128, whose value in 8-bit two's complement representation is:
@@ -233,6 +238,10 @@ <h1 id="型キャスト"><a class="header" href="#型キャスト">型キャス
233238
// when casting from float to int. If the floating point value exceeds
234239
// the upper bound or is less than the lower bound, the returned value
235240
// will be equal to the bound crossed.
241+
// Rust 1.45以降、浮動小数点数を整数にキャストするとき、
242+
// `as`キーワードが *飽和的キャスト* を行います。
243+
// 浮動小数点数の値が上限を超えたり下限を下回ったりする場合は、
244+
// 戻り値は越えられた境界の値となります。
236245

237246
// 300.0 as u8 is 255
238247
println!(&quot; 300.0 as u8 is : {}&quot;, 300.0_f32 as u8);
@@ -244,6 +253,9 @@ <h1 id="型キャスト"><a class="header" href="#型キャスト">型キャス
244253
// This behavior incurs a small runtime cost and can be avoided
245254
// with unsafe methods, however the results might overflow and
246255
// return **unsound values**. Use these methods wisely:
256+
// この挙動は実行時にややコストがかかるため、安全でない方法で回避できます。
257+
// ただし、結果はオーバーフローしたり *不正確な値* を返す場合があります。
258+
// この方法は賢く使いましょう:
247259
unsafe {
248260
// 300.0 as u8 is 44
249261
println!(&quot; 300.0 as u8 is : {}&quot;, 300.0_f32.to_int_unchecked::&lt;u8&gt;());

0 commit comments

Comments
 (0)