File tree Expand file tree Collapse file tree 1 file changed +1
-9
lines changed
src/hello/print/print_display Expand file tree Collapse file tree 1 file changed +1
-9
lines changed Original file line number Diff line number Diff line change @@ -13,14 +13,6 @@ Using `?` on `write!` looks like this:
1313write!(f, "{}", value)?;
1414```
1515
16- Alternatively, you can also use the ` try! ` macro, which works the same way.
17- This is a bit more verbose and no longer recommended, but you may still see it in
18- older Rust code. Using ` try! ` looks like this:
19-
20- ``` rust,ignore
21- try!(write!(f, "{}", value));
22- ```
23-
2416With ` ? ` available, implementing ` fmt::Display ` for a ` Vec ` is
2517straightforward:
2618
@@ -42,7 +34,7 @@ impl fmt::Display for List {
4234 // count in `count`.
4335 for (count, v) in vec.iter().enumerate() {
4436 // For every element except the first, add a comma.
45- // Use the ? operator, or try!, to return on errors.
37+ // Use the ? operator to return on errors.
4638 if count != 0 { write!(f, ", ")?; }
4739 write!(f, "{}", v)?;
4840 }
You can’t perform that action at this time.
0 commit comments