Skip to content
This repository was archived by the owner on Aug 16, 2021. It is now read-only.

Commit 946d6d5

Browse files
committed
Added name() to book docs
1 parent 213b7c6 commit 946d6d5

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

book/src/error-errorkind.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ yourself:
3939

4040
```rust
4141
impl Fail for MyError {
42+
fn name(&self) -> Option<&str> {
43+
self.inner.name()
44+
}
45+
4246
fn cause(&self) -> Option<&Fail> {
4347
self.inner.cause()
4448
}

book/src/string-custom-error.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ pub struct MyError {
2020
}
2121

2222
impl Fail for MyError {
23+
fn name(&self) -> Option<&str> {
24+
self.inner.name()
25+
}
26+
2327
fn cause(&self) -> Option<&Fail> {
2428
self.inner.cause()
2529
}
@@ -105,6 +109,10 @@ pub struct MyError {
105109
}
106110

107111
impl Fail for MyError {
112+
fn name(&self) -> Option<&str> {
113+
self.inner.name()
114+
}
115+
108116
fn cause(&self) -> Option<&Fail> {
109117
self.inner.cause()
110118
}

0 commit comments

Comments
 (0)