Skip to content

Commit

Permalink
(fix) Updated example to FromFn
Browse files Browse the repository at this point in the history
  • Loading branch information
reem committed Jun 30, 2014
1 parent fa9d8e1 commit fe36c2d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/hello.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::io::net::ip::Ipv4Addr;

use iron::{Iron, Chain, Alloy, Request, Response, ServerT};
use iron::mixin::Serve;
use iron::middleware::{Status, Continue};
use iron::middleware::{Status, Continue, FromFn};

fn hello_world(_req: &mut Request, res: &mut Response, _alloy: &mut Alloy) -> Status {
let _ = res.serve(::http::status::Ok, "Hello, world!");
Expand All @@ -14,7 +14,7 @@ fn hello_world(_req: &mut Request, res: &mut Response, _alloy: &mut Alloy) -> St

fn main() {
let mut server: ServerT = Iron::new();
server.chain.link(hello_world);
server.chain.link(FromFn::new(hello_world));
server.listen(Ipv4Addr(127, 0, 0, 1), 3000);
}

0 comments on commit fe36c2d

Please sign in to comment.