Skip to content

Commit 2bf936d

Browse files
committed
TRPL: minimize diff between examples in "Error Handling"
Two successive examples were slightly different for no reason.
1 parent 5708b1a commit 2bf936d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/doc/trpl/error-handling.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ fn descriptive_probability(event: Event) -> &'static str {
7171
}
7272
7373
fn main() {
74-
std::io::println(descriptive_probability(NewRelease));
74+
println!("{}", descriptive_probability(Event::NewRelease));
7575
}
7676
```
7777

@@ -85,8 +85,6 @@ While we know that we've covered all possible cases, Rust can't tell. It
8585
doesn't know that probability is between 0.0 and 1.0. So we add another case:
8686

8787
```rust
88-
use Event::NewRelease;
89-
9088
enum Event {
9189
NewRelease,
9290
}
@@ -109,7 +107,7 @@ fn descriptive_probability(event: Event) -> &'static str {
109107
}
110108

111109
fn main() {
112-
println!("{}", descriptive_probability(NewRelease));
110+
println!("{}", descriptive_probability(Event::NewRelease));
113111
}
114112
```
115113

0 commit comments

Comments
 (0)