From 783073b4fbc8bb974b04467b821c15e88d3c970e Mon Sep 17 00:00:00 2001 From: René Kijewski Date: Wed, 5 Jan 2022 11:38:36 +0100 Subject: Update for actix-web beta --- askama_shared/src/generator.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'askama_shared/src/generator.rs') 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 {", )?; - - buf.writeln("use ::askama_actix::TemplateToResponse;")?; - buf.writeln("::askama_actix::futures::ready(self.to_response())")?; - + buf.writeln("::to_response(&self)")?; buf.writeln("}")?; buf.writeln("}") } -- cgit