Fixed bad reference to echo server example.
This commit is contained in:
@@ -19,12 +19,12 @@ The documentation is located at [http://hyperium.github.io/hyper](http://hyperiu
|
|||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
Echo Server:
|
Hello World Server:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
fn echo(mut incoming: Incoming) {
|
fn hello(mut incoming: Incoming) {
|
||||||
for (_, mut res) in incoming {
|
for (_, mut res) in incoming {
|
||||||
*res.status_mut() = hyper::status::Ok;
|
*res.status_mut() = status::Ok;
|
||||||
let mut res = res.start().unwrap();
|
let mut res = res.start().unwrap();
|
||||||
res.write(b"Hello World!");
|
res.write(b"Hello World!");
|
||||||
res.end().unwrap();
|
res.end().unwrap();
|
||||||
@@ -33,7 +33,7 @@ fn echo(mut incoming: Incoming) {
|
|||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let server = Server::http(Ipv4Addr(127, 0, 0, 1), 1337);
|
let server = Server::http(Ipv4Addr(127, 0, 0, 1), 1337);
|
||||||
server.listen(echo).unwrap();
|
server.listen(hello).unwrap();
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user