Skip to content

Commit

Permalink
Merge pull request #1203 from Rosto75/master
Browse files Browse the repository at this point in the history
Add Cargo comment to the `try!` macro example.
  • Loading branch information
marioidival committed Jun 14, 2019
2 parents db0b207 + 6216eda commit 70f4354
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/error/multiple_error_types/reenter_question_mark.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ Here, we rewrite the previous example using `?`. As a result, the
```rust,editable
use std::error;
use std::fmt;
use std::num::ParseIntError;
// Change the alias to `Box<error::Error>`.
type Result<T> = std::result::Result<T, Box<error::Error>>;
Expand Down
3 changes: 3 additions & 0 deletions src/error/result/enter_question_mark.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ at older code. The same `multiply` function from the previous example
would look like this using `try!`:

```rust,editable
// To compile and run this example without errors, while using Cargo, change the value
// of the `edition` field, in the `[package]` section of the `Cargo.toml` file, to "2015".
use std::num::ParseIntError;
fn multiply(first_number_str: &str, second_number_str: &str) -> Result<i32, ParseIntError> {
Expand Down

0 comments on commit 70f4354

Please sign in to comment.