Why not #[derive(Clone)] on the Server struct.
Let's you call server.clone() on the server object directly instead of needing to wrap it in another Arc
i.e. using
let server = tiny_http::Server::http("0.0.0.0:9975").unwrap();
let handles: Vec<_> = (0..8)
.map(|_| {
let server = server.clone();
thread::spawn(move || for rq in server.incoming_requests() { . . . } )
})
.collect();
. . .
}
in stead of using
let server = Arc::new(tiny_http::Server::http("0.0.0.0:9975").unwrap());
Why not
#[derive(Clone)]on theServerstruct.Let's you call
server.clone()on the server object directly instead of needing to wrap it in anotherArci.e. using
in stead of using