I managed to run into a lifetime issue again that I seem to be unable to resolve on my own.
The compiler tells me cannot infer an appropriate lifetime for automa
OK, so I pulled down your code to try and compile it. Indeed, if we take a look at the definition of your Response
struct, we see this:
pub struct Response<'a> {
///the original `http::server::ResponseWriter`
pub origin: &'a mut http::server::ResponseWriter<'a>,
}
From the compiler's perspective, this definition claims that the lifetime of the pointer to a http::server::ResponseWriter
is the same as whatever lifetime is inside of http::server::ResponseWriter
. I don't see any particular reason why this should be true, and it looks like the compiler can't either. So to fix it, you need to introduce another lifetime parameter so that you allow for the possibility that the lifetimes are distinct:
pub struct Response<'a, 'b> {
///the original `http::server::ResponseWriter`
pub origin: &'a mut http::server::ResponseWriter<'b>,
}
Here's the fix in a PR for you: https://github.com/BurntSushi/Floor/commit/127962b9afc2779c9103c28f37e52e8d292f9ff2