Skip to content

Commit

Permalink
minor touch ups
Browse files Browse the repository at this point in the history
  • Loading branch information
pretzelhammer committed Apr 6, 2021
1 parent 94cb754 commit d8fc9f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion posts/tour-of-rusts-standard-library-traits.md
Original file line number Diff line number Diff line change
Expand Up @@ -3800,6 +3800,8 @@ impl fmt::Display for SumFileError {
}

impl error::Error for SumFileError {
// the default impl for this method always returns None
// but we can now override it to make it way more useful!
fn source(&self) -> Option<&(dyn error::Error + 'static)> {
Some(match self {
SumFileError::Io(err) => err,
Expand Down Expand Up @@ -4799,7 +4801,7 @@ trait Iterator {
}
```

An `Iterator<Item = T>` type can be iterated and will produce `T` types. There's no `IteratorMut` trait. Each `Iterator` impl can specify whether it returns immutable references, mutable references, or owned values via the `Item` associated type.
`Iterator<Item = T>` types can be iterated and will produce `T` types. There's no `IteratorMut` trait. Each `Iterator` impl can specify whether it returns immutable references, mutable references, or owned values via the `Item` associated type.

| `Vec<T>` method | Returns |
|-----------------|-------------------|
Expand Down

0 comments on commit d8fc9f7

Please sign in to comment.