Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions src/hello/print/print_display/testcase_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,6 @@ Using `?` on `write!` looks like this:
write!(f, "{}", value)?;
```

Alternatively, you can also use the `try!` macro, which works the same way.
This is a bit more verbose and no longer recommended, but you may still see it in
older Rust code. Using `try!` looks like this:

```rust,ignore
try!(write!(f, "{}", value));
```

With `?` available, implementing `fmt::Display` for a `Vec` is
straightforward:

Expand All @@ -42,7 +34,7 @@ impl fmt::Display for List {
// count in `count`.
for (count, v) in vec.iter().enumerate() {
// For every element except the first, add a comma.
// Use the ? operator, or try!, to return on errors.
// Use the ? operator to return on errors.
if count != 0 { write!(f, ", ")?; }
write!(f, "{}", v)?;
}
Expand Down