Skip to content

Commit 71dfa07

Browse files
committed
ci: generate pages at 6e758d2 [ci skip]
1 parent 6e758d2 commit 71dfa07

File tree

4 files changed

+30
-30
lines changed

4 files changed

+30
-30
lines changed

docs/ch12-03-improving-error-handling-and-modularity.html

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@ <h4 id="run関数からエラーを返す"><a class="header" href="#run関数か
899899

900900
// --snip--
901901

902-
fn run(config: Config) -&gt; Result&lt;(), Box&lt;Error&gt;&gt; {
902+
fn run(config: Config) -&gt; Result&lt;(), Box&lt;dyn Error&gt;&gt; {
903903
let mut f = File::open(config.filename)?;
904904

905905
let mut contents = String::new();
@@ -917,26 +917,26 @@ <h4 id="run関数からエラーを返す"><a class="header" href="#run関数か
917917
<p><span class="caption">リスト12-12: <code>run</code>関数を変更して<code>Result</code>を返す</span></p>
918918
<!--
919919
We’ve made three significant changes here. First, we changed the return type of
920-
the `run` function to `Result<(), Box<Error>>`. This function previously
920+
the `run` function to `Result<(), Box<dyn Error>>`. This function previously
921921
returned the unit type, `()`, and we keep that as the value returned in the
922922
`Ok` case.
923923
-->
924-
<p>ここでは、3つの大きな変更を行いました。まず、<code>run</code>関数の戻り値を<code>Result&lt;(), Box&lt;Error&gt;&gt;</code>に変えました。
924+
<p>ここでは、3つの大きな変更を行いました。まず、<code>run</code>関数の戻り値を<code>Result&lt;(), Box&lt;dyn Error&gt;&gt;</code>に変えました。
925925
この関数は、以前はユニット型、<code>()</code>を返していて、それを<code>Ok</code>の場合に返される値として残しました。</p>
926926
<!--
927-
For the error type, we used the *trait object* `Box<Error>` (and we’ve brought
928-
`std::error::Error` into scope with a `use` statement at the top). We’ll cover
929-
trait objects in Chapter 17. For now, just know that `Box<Error>` means the
930-
function will return a type that implements the `Error` trait, but we don’t
931-
have to specify what particular type the return value will be. This gives us
932-
flexibility to return error values that may be of different types in different
933-
error cases.
927+
For the error type, we used the *trait object* `Box<dyn Error>` (and we’ve
928+
brought `std::error::Error` into scope with a `use` statement at the top).
929+
We’ll cover trait objects in Chapter 17. For now, just know that `Box<dyn
930+
Error>` means the function will return a type that implements the `Error`
931+
trait, but we don’t have to specify what particular type the return value will
932+
be. This gives us flexibility to return error values that may be of different
933+
types in different error cases. The `dyn` keyword is short for “dynamic.”
934934
-->
935-
<p>エラー型については、<em>トレイトオブジェクト</em><code>Box&lt;Error&gt;</code>を使用しました(同時に冒頭で<code>use</code>文により、
935+
<p>エラー型については、<em>トレイトオブジェクト</em><code>Box&lt;dyn Error&gt;</code>を使用しました(同時に冒頭で<code>use</code>文により、
936936
<code>std::error::Error</code>をスコープに導入しています)。トレイトオブジェクトについては、第17章で講義します。
937-
とりあえず、<code>Box&lt;Error&gt;</code>は、関数が<code>Error</code>トレイトを実装する型を返すことを意味しますが、
937+
とりあえず、<code>Box&lt;dyn Error&gt;</code>は、関数が<code>Error</code>トレイトを実装する型を返すことを意味しますが、
938938
戻り値の型を具体的に指定しなくても良いことを知っておいてください。これにより、
939-
エラーケースによって異なる型のエラー値を返す柔軟性を得ます。</p>
939+
エラーケースによって異なる型のエラー値を返す柔軟性を得ます。<code>dyn</code> キーワードは、&quot;dynamic&quot;の略です。</p>
940940
<!--
941941
Second, we’ve removed the calls to `expect` in favor of the `?` operator, as we
942942
talked about in Chapter 9. Rather than `panic!` on an error, the `?` operator
@@ -1079,7 +1079,7 @@ <h3 id="コードをライブラリクレートに分割する"><a class="header
10791079
}
10801080
}
10811081

1082-
pub fn run(config: Config) -&gt; Result&lt;(), Box&lt;Error&gt;&gt; {
1082+
pub fn run(config: Config) -&gt; Result&lt;(), Box&lt;dyn Error&gt;&gt; {
10831083
// --snip--
10841084
}
10851085
</code></pre>

docs/print.html

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21761,7 +21761,7 @@ <h4 id="run関数からエラーを返す"><a class="header" href="#run関数か
2176121761

2176221762
// --snip--
2176321763

21764-
fn run(config: Config) -&gt; Result&lt;(), Box&lt;Error&gt;&gt; {
21764+
fn run(config: Config) -&gt; Result&lt;(), Box&lt;dyn Error&gt;&gt; {
2176521765
let mut f = File::open(config.filename)?;
2176621766

2176721767
let mut contents = String::new();
@@ -21779,26 +21779,26 @@ <h4 id="run関数からエラーを返す"><a class="header" href="#run関数か
2177921779
<p><span class="caption">リスト12-12: <code>run</code>関数を変更して<code>Result</code>を返す</span></p>
2178021780
<!--
2178121781
We’ve made three significant changes here. First, we changed the return type of
21782-
the `run` function to `Result<(), Box<Error>>`. This function previously
21782+
the `run` function to `Result<(), Box<dyn Error>>`. This function previously
2178321783
returned the unit type, `()`, and we keep that as the value returned in the
2178421784
`Ok` case.
2178521785
-->
21786-
<p>ここでは、3つの大きな変更を行いました。まず、<code>run</code>関数の戻り値を<code>Result&lt;(), Box&lt;Error&gt;&gt;</code>に変えました。
21786+
<p>ここでは、3つの大きな変更を行いました。まず、<code>run</code>関数の戻り値を<code>Result&lt;(), Box&lt;dyn Error&gt;&gt;</code>に変えました。
2178721787
この関数は、以前はユニット型、<code>()</code>を返していて、それを<code>Ok</code>の場合に返される値として残しました。</p>
2178821788
<!--
21789-
For the error type, we used the *trait object* `Box<Error>` (and we’ve brought
21790-
`std::error::Error` into scope with a `use` statement at the top). We’ll cover
21791-
trait objects in Chapter 17. For now, just know that `Box<Error>` means the
21792-
function will return a type that implements the `Error` trait, but we don’t
21793-
have to specify what particular type the return value will be. This gives us
21794-
flexibility to return error values that may be of different types in different
21795-
error cases.
21789+
For the error type, we used the *trait object* `Box<dyn Error>` (and we’ve
21790+
brought `std::error::Error` into scope with a `use` statement at the top).
21791+
We’ll cover trait objects in Chapter 17. For now, just know that `Box<dyn
21792+
Error>` means the function will return a type that implements the `Error`
21793+
trait, but we don’t have to specify what particular type the return value will
21794+
be. This gives us flexibility to return error values that may be of different
21795+
types in different error cases. The `dyn` keyword is short for “dynamic.”
2179621796
-->
21797-
<p>エラー型については、<em>トレイトオブジェクト</em>の<code>Box&lt;Error&gt;</code>を使用しました(同時に冒頭で<code>use</code>文により、
21797+
<p>エラー型については、<em>トレイトオブジェクト</em>の<code>Box&lt;dyn Error&gt;</code>を使用しました(同時に冒頭で<code>use</code>文により、
2179821798
<code>std::error::Error</code>をスコープに導入しています)。トレイトオブジェクトについては、第17章で講義します。
21799-
とりあえず、<code>Box&lt;Error&gt;</code>は、関数が<code>Error</code>トレイトを実装する型を返すことを意味しますが、
21799+
とりあえず、<code>Box&lt;dyn Error&gt;</code>は、関数が<code>Error</code>トレイトを実装する型を返すことを意味しますが、
2180021800
戻り値の型を具体的に指定しなくても良いことを知っておいてください。これにより、
21801-
エラーケースによって異なる型のエラー値を返す柔軟性を得ます。</p>
21801+
エラーケースによって異なる型のエラー値を返す柔軟性を得ます。<code>dyn</code> キーワードは、&quot;dynamic&quot;の略です。</p>
2180221802
<!--
2180321803
Second, we’ve removed the calls to `expect` in favor of the `?` operator, as we
2180421804
talked about in Chapter 9. Rather than `panic!` on an error, the `?` operator
@@ -21941,7 +21941,7 @@ <h3 id="コードをライブラリクレートに分割する"><a class="header
2194121941
}
2194221942
}
2194321943

21944-
pub fn run(config: Config) -&gt; Result&lt;(), Box&lt;Error&gt;&gt; {
21944+
pub fn run(config: Config) -&gt; Result&lt;(), Box&lt;dyn Error&gt;&gt; {
2194521945
// --snip--
2194621946
}
2194721947
</code></pre>

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)