Skip to content

Commit

Permalink
Fix reference to supertrait syntax in 09_error_trait.md (#124)
Browse files Browse the repository at this point in the history
The [Error trait](https://rust-exercises.com/100-exercises/05_ticket_v2/09_error_trait.html?highlight=supertrait#the-error-trait) chapter states that the reader may recall the supertrait syntax from the [Sized trait](https://rust-exercises.com/100-exercises/04_traits/08_sized) chapter. Actually the syntax is introduced in the [From and Into](https://rust-exercises.com/100-exercises/04_traits/09_from) chapter instead. This PR amends the text accordingly.
  • Loading branch information
mckzm authored Aug 5, 2024
1 parent 96f0670 commit 2765fda
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion book/src/05_ticket_v2/09_error_trait.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ that implements the `Error` trait.
pub trait Error: Debug + Display {}
```

You might recall the `:` syntax from [the `Sized` trait](../04_traits/08_sized.md)—it's used to specify **supertraits**.
You might recall the `:` syntax from [the `From` trait](../04_traits/09_from.md#supertrait--subtrait)—it's used to specify **supertraits**.
For `Error`, there are two supertraits: `Debug` and `Display`. If a type wants to implement `Error`, it must also
implement `Debug` and `Display`.

Expand Down

0 comments on commit 2765fda

Please sign in to comment.