Skip to content
This repository was archived by the owner on Aug 16, 2021. It is now read-only.

Commit 16db7d1

Browse files
authored
Merge pull request #35 from nelsonjchen/cleanup_quickstart
Cleanup quickstart for 0.5
2 parents 4564013 + de7e873 commit 16db7d1

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ provides a few unique features:
1919
Add this to Cargo.toml, under `[dependencies]`:
2020

2121
```toml
22-
error-chain = "0.4"
22+
error-chain = "0.5"
2323
```
2424

2525
Write this at the top of your crate:
2626

2727
```rust
28-
#![recursion_limit = "1024"];
28+
#![recursion_limit = "1024"]
2929
```
3030

3131
Again near the top of your crate, import the `error_chain` crate and its macros:
@@ -60,7 +60,7 @@ the `error_chain!` macro, and start chaining errors!
6060
```rust
6161
fn do_error_prone_work() -> Result<()> {
6262
let file = try!(File::open("foo").chain_err(|| "couldn't open file"));
63-
try!(file.write_str("important").chain_err(|| "couldn't write file"));
63+
try!(file.write_all("important".as_bytes()).chain_err(|| "couldn't write file"));
6464

6565
Ok(())
6666
}

src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@
5959
//! Add this to Cargo.toml, under `[dependencies]`:
6060
//!
6161
//! ```toml
62-
//! error-chain = "0.4"
62+
//! error-chain = "0.5"
6363
//! ```
6464
//!
6565
//! Write this at the top of your crate:
6666
//!
6767
//! ```ignore
68-
//! #![recursion_limit = "1024"];
68+
//! #![recursion_limit = "1024"]
6969
//! ```
7070
//!
7171
//! Again near the top of your crate, import the `error_chain` crate and its macros:
@@ -100,7 +100,7 @@
100100
//! ```ignore
101101
//! fn do_error_prone_work() -> Result<()> {
102102
//! let file = try!(File::open("foo").chain_err(|| "couldn't open file"));
103-
//! try!(file.write_str("important").chain_err(|| "couldn't write file"));
103+
//! try!(file.write_all("important".as_bytes()).chain_err(|| "couldn't write file"));
104104
//!
105105
//! Ok(())
106106
//! }

0 commit comments

Comments
 (0)