From 2dbdcdfb640a5e7c1eecfd6eae71ea9d5a05723e Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Mon, 15 Feb 2021 10:11:51 +0100 Subject: Rename askama_actix trait method as suggested by clippy By bumping the dependency versions for askama and askama_shared, this should be safe. --- askama_actix/Cargo.toml | 2 +- askama_actix/src/lib.rs | 8 ++++---- askama_actix/tests/basic.rs | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'askama_actix') diff --git a/askama_actix/Cargo.toml b/askama_actix/Cargo.toml index 0d5a836..a518ca2 100644 --- a/askama_actix/Cargo.toml +++ b/askama_actix/Cargo.toml @@ -15,7 +15,7 @@ edition = "2018" [dependencies] actix-web = { version = "3", default-features = false } -askama = { version = "0.10", path = "../askama", default-features = false, features = ["with-actix-web", "mime", "mime_guess"] } +askama = { version = "0.10.6", path = "../askama", default-features = false, features = ["with-actix-web", "mime", "mime_guess"] } bytes = { version = "0.5" } futures-util = { version = "0.3" } diff --git a/askama_actix/src/lib.rs b/askama_actix/src/lib.rs index e0f78ca..742c7f2 100644 --- a/askama_actix/src/lib.rs +++ b/askama_actix/src/lib.rs @@ -3,12 +3,12 @@ use bytes::BytesMut; use actix_web::{error::ErrorInternalServerError, Error, HttpResponse}; -pub trait TemplateIntoResponse { - fn into_response(&self) -> ::std::result::Result; +pub trait TemplateToResponse { + fn to_response(&self) -> ::std::result::Result; } -impl TemplateIntoResponse for T { - fn into_response(&self) -> ::std::result::Result { +impl TemplateToResponse for T { + fn to_response(&self) -> ::std::result::Result { let mut buffer = BytesMut::with_capacity(self.size_hint()); self.render_into(&mut buffer) .map_err(|_| ErrorInternalServerError("Template parsing error"))?; diff --git a/askama_actix/tests/basic.rs b/askama_actix/tests/basic.rs index 4f600fb..125270f 100644 --- a/askama_actix/tests/basic.rs +++ b/askama_actix/tests/basic.rs @@ -1,7 +1,7 @@ use actix_web::http::header::CONTENT_TYPE; use actix_web::test; use actix_web::web; -use askama_actix::{Template, TemplateIntoResponse}; +use askama_actix::{Template, TemplateToResponse}; use bytes::Bytes; #[derive(Template)] @@ -34,7 +34,7 @@ async fn test_actix_web_responder() { let srv = test::start(|| { actix_web::App::new().service(web::resource("/").to(|| async { let name = "world".to_owned(); - HelloTemplate { name: &name }.into_response() + HelloTemplate { name: &name }.to_response() })) }); -- cgit