Skip to content

Commit

Permalink
Merge pull request #181 from sangheestyle/fix_example_readme
Browse files Browse the repository at this point in the history
docs: Correct sample code in README

Previously, the README example used `failure::Error`. While `failure` is a useful library in many scenarios, `app.serve()` returns `std::io::Result`. Removing `failure` allows the example to compile without additional changes, which could trip up new framework users.
  • Loading branch information
Nicholas authored Apr 21, 2019
2 parents e06ae37 + 0ac0168 commit d78001f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ __Hello World__
```rust
#![feature(async_await)]

fn main() -> Result<(), failure::Error> {
fn main() -> Result<(), std::io::Error> {
let mut app = tide::App::new(());
app.at("/").get(async move |_| "Hello, world!");
app.serve("127.0.0.1:8000")?;
Ok(app.serve("127.0.0.1:8000")?)
}
```

Expand Down

0 comments on commit d78001f

Please sign in to comment.