-
-
Notifications
You must be signed in to change notification settings - Fork 215
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
Add TemplateResponder trait for integration with actix-web #205
Conversation
Should we remove the current approach, then, or does it address a different use case? |
The current approach can be removed. I just don't know if you are fine with
the breaking change.
…On Sun, Jan 27, 2019, 5:00 AM Dirkjan Ochtman ***@***.*** wrote:
Should we remove the current approach, then, or does it address a
different use case?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#205 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AE9qWJvd9iUBGKUMxdvIXqUJGyX4iEtJks5vHaLkgaJpZM4aUj3p>
.
|
I don't think the current approach should be removed. I like the addition for flexibility but I think it would cause unnecessary breakage as well as no longer allowing the shorter syntax when local variables do not need to be computed. |
Closing, no longer necessary (see #204). |
@djc, I think there is a misunderstanding. This PR isn't doing the same thing as #204. #204 only provides a way to return a template without specifying the concrete return type (but instead with a Could you please reopen this PR and review it? Thank you. |
Any updates on this? |
So as I understand we can only generate code for the new approach, remove the old |
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'll just merge this and do some follow-ups.
This is similar to what
actix_web::AsyncResponder
does. It enables us to call.responder()
on a template to render it into anactix_web::HttpResponse
. This is advantageous over the current approach (implementingactix_web::Responder
forT: Template
) because the current approach doesn't allow returning templates with references to local variables. Please see the added test for what I mean.