aboutsummaryrefslogtreecommitdiffstats
path: root/askama_shared/src
diff options
context:
space:
mode:
authorLibravatar René Kijewski <kijewski@library.vetmed.fu-berlin.de>2022-01-05 11:38:36 +0100
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2022-01-05 13:57:53 +0100
commit783073b4fbc8bb974b04467b821c15e88d3c970e (patch)
tree722a24b76f50757b99ebc6dc0bf6faeedbb83f57 /askama_shared/src
parent2f8bdba17c5602d5f19330fcb7db474c9f2b1662 (diff)
downloadaskama-783073b4fbc8bb974b04467b821c15e88d3c970e.tar.gz
askama-783073b4fbc8bb974b04467b821c15e88d3c970e.tar.bz2
askama-783073b4fbc8bb974b04467b821c15e88d3c970e.zip
Update for actix-web beta
Diffstat (limited to '')
-rw-r--r--askama_shared/src/generator.rs10
1 files changed, 3 insertions, 7 deletions
diff --git a/askama_shared/src/generator.rs b/askama_shared/src/generator.rs
index 398c106..ad413ea 100644
--- a/askama_shared/src/generator.rs
+++ b/askama_shared/src/generator.rs
@@ -201,16 +201,12 @@ impl<'a, S: std::hash::BuildHasher> Generator<'a, S> {
// Implement Actix-web's `Responder`.
fn impl_actix_web_responder(&mut self, buf: &mut Buffer) -> Result<(), CompileError> {
self.write_header(buf, "::actix_web::Responder", None)?;
- buf.writeln("type Future = ::askama_actix::futures::Ready<::std::result::Result<::actix_web::HttpResponse, Self::Error>>;")?;
- buf.writeln("type Error = ::actix_web::Error;")?;
+ buf.writeln("type Body = ::actix_web::body::BoxBody;")?;
buf.writeln(
"fn respond_to(self, _req: &::actix_web::HttpRequest) \
- -> Self::Future {",
+ -> ::actix_web::web::HttpResponse<Self::Body> {",
)?;
-
- buf.writeln("use ::askama_actix::TemplateToResponse;")?;
- buf.writeln("::askama_actix::futures::ready(self.to_response())")?;
-
+ buf.writeln("<Self as ::askama_actix::TemplateToResponse>::to_response(&self)")?;
buf.writeln("}")?;
buf.writeln("}")
}