File tree 1 file changed +1
-9
lines changed
src/hello/print/print_display
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:
13
13
write!(f, "{}", value)?;
14
14
```
15
15
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
-
24
16
With ` ? ` available, implementing ` fmt::Display ` for a ` Vec ` is
25
17
straightforward:
26
18
@@ -42,7 +34,7 @@ impl fmt::Display for List {
42
34
// count in `count`.
43
35
for (count, v) in vec.iter().enumerate() {
44
36
// 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.
46
38
if count != 0 { write!(f, ", ")?; }
47
39
write!(f, "{}", v)?;
48
40
}
You can’t perform that action at this time.
0 commit comments