1 use std::net::TcpListener;
2 use std::net::TcpStream;
3 use std::io::{self, Read, Write};
5 fn handle_client(stream: TcpStream) -> io::Result<()> {
6 stream.write_fmt(format!("message received"))
7 //~^ ERROR mismatched types
11 if let Ok(listener) = TcpListener::bind("127.0.0.1:8080") {
12 for incoming in listener.incoming() {
13 if let Ok(stream) = incoming {
14 handle_client(stream);