Skip to content

Commit

Permalink
fix(README): Update to compile example against Rust beta
Browse files Browse the repository at this point in the history
Remove unused import
res doesn't need to be mutable in parameter list
Change .listen() to string format
  • Loading branch information
mfeckie committed Apr 4, 2015
1 parent 4fecd64 commit 341f19d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,20 @@ Hello World Server:
extern crate hyper;

use std::io::Write;
use std::net::Ipv4Addr;

use hyper::Server;
use hyper::server::Request;
use hyper::server::Response;
use hyper::net::Fresh;

fn hello(_: Request, mut res: Response<Fresh>) {
fn hello(_: Request, res: Response<Fresh>) {
let mut res = res.start().unwrap();
res.write_all(b"Hello World!").unwrap();
res.end().unwrap();
}

fn main() {
Server::http(hello).listen(Ipv4Addr::new(127, 0, 0, 1), 3000).unwrap();
Server::http(hello).listen("127.0.0.1:3000").unwrap();
}
```

Expand Down

0 comments on commit 341f19d

Please sign in to comment.