aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2021-02-15 10:11:51 +0100
committerLibravatar Christian Vallentin <vallentinsource@gmail.com>2021-02-15 11:10:48 +0100
commit2dbdcdfb640a5e7c1eecfd6eae71ea9d5a05723e (patch)
tree43fd2629b0d61df8ce1db8961ec476c1a4c6ad4b
parentf5f35dad5626ad20d20f8497227428057bc0d841 (diff)
downloadaskama-2dbdcdfb640a5e7c1eecfd6eae71ea9d5a05723e.tar.gz
askama-2dbdcdfb640a5e7c1eecfd6eae71ea9d5a05723e.tar.bz2
askama-2dbdcdfb640a5e7c1eecfd6eae71ea9d5a05723e.zip
Rename askama_actix trait method as suggested by clippy
By bumping the dependency versions for askama and askama_shared, this should be safe.
Diffstat (limited to '')
-rw-r--r--askama/Cargo.toml4
-rw-r--r--askama_actix/Cargo.toml2
-rw-r--r--askama_actix/src/lib.rs8
-rw-r--r--askama_actix/tests/basic.rs4
-rw-r--r--askama_shared/Cargo.toml2
-rw-r--r--askama_shared/src/generator.rs4
6 files changed, 12 insertions, 12 deletions
diff --git a/askama/Cargo.toml b/askama/Cargo.toml
index da53a98..32ab974 100644
--- a/askama/Cargo.toml
+++ b/askama/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "askama"
-version = "0.10.5"
+version = "0.10.6"
authors = ["Dirkjan Ochtman <dirkjan@ochtman.nl>"]
description = "Type-safe, compiled Jinja-like templates for Rust"
documentation = "https://docs.rs/askama"
@@ -35,7 +35,7 @@ with-warp = ["askama_derive/warp"]
[dependencies]
askama_derive = { version = "0.10.5", path = "../askama_derive" }
askama_escape = { version = "0.10", path = "../askama_escape" }
-askama_shared = { version = "0.11", path = "../askama_shared", default-features = false }
+askama_shared = { version = "0.11.2", path = "../askama_shared", default-features = false }
mime = { version = "0.3", optional = true }
mime_guess = { version = "2.0.0-alpha", optional = true }
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<HttpResponse, Error>;
+pub trait TemplateToResponse {
+ fn to_response(&self) -> ::std::result::Result<HttpResponse, Error>;
}
-impl<T: askama::Template> TemplateIntoResponse for T {
- fn into_response(&self) -> ::std::result::Result<HttpResponse, Error> {
+impl<T: askama::Template> TemplateToResponse for T {
+ fn to_response(&self) -> ::std::result::Result<HttpResponse, Error> {
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()
}))
});
diff --git a/askama_shared/Cargo.toml b/askama_shared/Cargo.toml
index a628aa4..e341b2e 100644
--- a/askama_shared/Cargo.toml
+++ b/askama_shared/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "askama_shared"
-version = "0.11.1"
+version = "0.11.2"
authors = ["Dirkjan Ochtman <dirkjan@ochtman.nl>"]
description = "Shared code for Askama"
homepage = "https://github.com/djc/askama"
diff --git a/askama_shared/src/generator.rs b/askama_shared/src/generator.rs
index 9907c0b..e74de14 100644
--- a/askama_shared/src/generator.rs
+++ b/askama_shared/src/generator.rs
@@ -221,8 +221,8 @@ impl<'a, S: std::hash::BuildHasher> Generator<'a, S> {
-> Self::Future {",
)?;
- buf.writeln("use ::askama_actix::TemplateIntoResponse;")?;
- buf.writeln("::askama_actix::futures::ready(self.into_response())")?;
+ buf.writeln("use ::askama_actix::TemplateToResponse;")?;
+ buf.writeln("::askama_actix::futures::ready(self.to_response())")?;
buf.writeln("}")?;
buf.writeln("}")