aboutsummaryrefslogtreecommitdiffstats
path: root/askama_escape
diff options
context:
space:
mode:
authorLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2018-12-07 15:52:26 +0100
committerLibravatar Juan Aguilar <mhpoin@gmail.com>2018-12-08 21:43:20 +0100
commit5549f9a3cd94e3cd6700067b1c74194dadb58a0f (patch)
treefa7037a3d4884a8c76ab7b4bea6d42b0bde0ff91 /askama_escape
parentd042c5d758a0b99288b99959d5d98462f18cde65 (diff)
downloadaskama-5549f9a3cd94e3cd6700067b1c74194dadb58a0f.tar.gz
askama-5549f9a3cd94e3cd6700067b1c74194dadb58a0f.tar.bz2
askama-5549f9a3cd94e3cd6700067b1c74194dadb58a0f.zip
Use 2018 edition idioms
Diffstat (limited to '')
-rw-r--r--askama_escape/benches/all.rs1
-rw-r--r--askama_escape/src/lib.rs6
2 files changed, 3 insertions, 4 deletions
diff --git a/askama_escape/benches/all.rs b/askama_escape/benches/all.rs
index e7dc7ed..af28c43 100644
--- a/askama_escape/benches/all.rs
+++ b/askama_escape/benches/all.rs
@@ -1,4 +1,3 @@
-extern crate askama_escape;
#[macro_use]
extern crate criterion;
diff --git a/askama_escape/src/lib.rs b/askama_escape/src/lib.rs
index b967f1f..8c23530 100644
--- a/askama_escape/src/lib.rs
+++ b/askama_escape/src/lib.rs
@@ -35,7 +35,7 @@ impl<T> Display for MarkupDisplay<T>
where
T: Display,
{
- fn fmt(&self, f: &mut Formatter) -> fmt::Result {
+ fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
match *self {
MarkupDisplay::Unsafe(ref t) => escape(&t.to_string()).fmt(f),
MarkupDisplay::Safe(ref t) => t.fmt(f),
@@ -43,7 +43,7 @@ where
}
}
-pub fn escape(s: &str) -> Escaped {
+pub fn escape(s: &str) -> Escaped<'_> {
Escaped {
bytes: s.as_bytes(),
}
@@ -64,7 +64,7 @@ pub struct Escaped<'a> {
}
impl<'a> ::std::fmt::Display for Escaped<'a> {
- fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+ fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
let mut start = 0;
for (i, b) in self.bytes.iter().enumerate() {
if b.wrapping_sub(b'"') <= FLAG {