Split Server::listen into two methods to hack around ICE related to default type params
Trying to default the type parameters leads to an ICE and strange type errors. I think this is just due to the experimental state of default type params and this change can be rolled back when they are fixed.
This commit is contained in:
@@ -19,7 +19,7 @@ trait ConcurrentHandler: Send + Sync {
|
||||
struct Concurrent<H: ConcurrentHandler> { handler: Arc<H> }
|
||||
|
||||
impl<H: ConcurrentHandler> Handler<HttpAcceptor, HttpStream> for Concurrent<H> {
|
||||
fn handle(self, mut incoming: Incoming<HttpAcceptor>) {
|
||||
fn handle(self, mut incoming: Incoming) {
|
||||
for (mut req, mut res) in incoming {
|
||||
let clone = self.handler.clone();
|
||||
spawn(proc() { clone.handle(req, res) })
|
||||
|
||||
Reference in New Issue
Block a user