From 42d80ad6cdb1a4ff9ff8fcc088b25d5f7b66a393 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Tue, 21 Dec 2021 23:17:14 +0100 Subject: askama_actix: revert to actix-web v3 for release --- askama_shared/src/generator.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'askama_shared/src/generator.rs') diff --git a/askama_shared/src/generator.rs b/askama_shared/src/generator.rs index 56c82aa..1d8d32b 100644 --- a/askama_shared/src/generator.rs +++ b/askama_shared/src/generator.rs @@ -201,14 +201,15 @@ 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 Body = actix_web::body::BoxBody;")?; + 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( "fn respond_to(self, _req: &::actix_web::HttpRequest) \ - -> ::actix_web::HttpResponse {", + -> Self::Future {", )?; buf.writeln("use ::askama_actix::TemplateToResponse;")?; - buf.writeln("self.to_response()")?; + buf.writeln("::askama_actix::futures::ready(self.to_response())")?; buf.writeln("}")?; buf.writeln("}") -- cgit