-
Notifications
You must be signed in to change notification settings - Fork 402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Solved the Great Response Crisis of Week 8 #30
Conversation
Shoutout to @Ogeon - thanks for your help. |
Solved the Great Response Crisis of Week 8
writer: writer | ||
} | ||
) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you transmuting this to what it already is? This is a bit risky and it could be avoided by defining the trait as
pub trait HttpResponse<'a, 'b> {
fn from_http(&'a mut ResponseWriter<'b>) -> Self;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was my original approach (you can see the remains on my great-response-crisis branch of my fork, if you're curious) but that doesn't work for the reasons @zzmp discussed with you on #iron last night.
I'm working on this in my fork's bug/lifetime-response branch. It may be a good starting-off point, though it does not compile. |
Move entirely to Cargo
(feat) HTTPS for rustup
Updates for upstream Iron changes.
By coercing lifetimes instead of types and moving from_http to its own trait, we have
managed to both allow new Response representations and remove all the lifetimes from
everywhere.
Such is the power of Sundays.