-
Notifications
You must be signed in to change notification settings - Fork 159
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
impl Responder for actix-web framework #136
impl Responder for actix-web framework #136
Conversation
If/when this looks good, I can write something up for the book https://github.com/lfairy/maud-book |
It looks similar to the Rocket implementation, and functionally is also similar: a syncronous response for PreEscaped<String> Refs lambda-fairy#135
ff86aea
to
5f608c7
Compare
Ah the infamous "cannot link ring" more than once. My understanding is that we need separate test builds for separate features. Bummer. Hopefully that gets fixed this year. Update I added that in, but I don't know if it's acceptable. |
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.
I was going to mention the book! Thanks for taking the initiative.
Overall the changes look good. The linking issue is unfortunate but should hopefully be temporary. I'm happy to merge this once the nits are addressed.
.travis.yml
Outdated
- cargo test --all --all-features | ||
- cargo test --all --features="iron" | ||
- cargo test --all --features="rocket" | ||
- cargo test --all --features="actix-web" |
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.
Can these lines use cargo build
instead? With one cargo test --all
at the end.
Since the web framework integrations aren't covered by the test suite, we can avoid clutter by only running the tests once.
maud/src/lib.rs
Outdated
impl Responder for PreEscaped<String> { | ||
type Item = HttpResponse; | ||
type Error = Error; | ||
fn respond_to<String>(self, _req: &HttpRequest<String>) -> Result<Self::Item, Self::Error> { |
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 is better written as
fn respond_to<S>(self, _req: &HttpRequest<S>) -> ...
to avoid confusion with the built-in String
type
Compiling rocket and actix-web together presents problems, since ring - a native dependency - cannot have more than one version linked.
5474bd9
to
9d9fe5b
Compare
@lfairy Can you merge this into master now? Because I use same implementation locally :) |
LGTM, thanks! |
It looks similar to the Rocket implementation, and functionally is also similar:
a syncronous response for PreEscaped
Refs #135