Skip to content

Commit

Permalink
Merge pull request rust-cli#8 from harsimranmaan/patch-1
Browse files Browse the repository at this point in the history
Update structopts version
  • Loading branch information
Dylan-DPC authored Apr 21, 2020
2 parents e5162b1 + 507ee1d commit abe566e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/tutorial/cli-args.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ and it’ll generate the code that parses the arguments into the fields.
[`structopt`]: https://docs.rs/structopt

Let's first import `structopt` by adding
`structopt = "0.2.10"` to the `[dependencies]` section
`structopt = "0.3.13"` to the `[dependencies]` section
of our `Cargo.toml` file.

Now, we can write `use structopt::StructOpt;` in our code,
Expand Down
10 changes: 5 additions & 5 deletions src/tutorial/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,18 +214,18 @@ The library also brings with it an extension trait ([`ResultExt`])
that adds [`context()`] and [`with_context()`] methods to `Result`.

[`failure`]: https://docs.rs/failure
[`Context`]: https://docs.rs/failure/0.1.3/failure/struct.Context.html
[`ResultExt`]: https://docs.rs/failure/0.1.3/failure/trait.ResultExt.html
[`context()`]: https://docs.rs/failure/0.1.3/failure/trait.ResultExt.html#tymethod.context
[`with_context()`]: https://docs.rs/failure/0.1.3/failure/trait.ResultExt.html#tymethod.with_context
[`Context`]: https://docs.rs/failure/0.1.7/failure/struct.Context.html
[`ResultExt`]: https://docs.rs/failure/0.1.7/failure/trait.ResultExt.html
[`context()`]: https://docs.rs/failure/0.1.7/failure/trait.ResultExt.html#tymethod.context
[`with_context()`]: https://docs.rs/failure/0.1.7/failure/trait.ResultExt.html#tymethod.with_context

To turn these wrapped error types
into something that humans will actually want to read,
we can further add the [`exitfailure`] crate,
and use its type as the return type of our `main` function.

Let's first import the crates by adding
`failure = "0.1.5"` and `exitfailure = "0.5.1"` to the `[dependencies]` section
`failure = "0.1.7"` and `exitfailure = "0.5.1"` to the `[dependencies]` section
of our `Cargo.toml` file.

The full example will then look like this:
Expand Down

0 comments on commit abe566e

Please sign in to comment.