From 5549f9a3cd94e3cd6700067b1c74194dadb58a0f Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Fri, 7 Dec 2018 15:52:26 +0100 Subject: Use 2018 edition idioms --- askama_escape/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'askama_escape/src/lib.rs') 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 Display for MarkupDisplay 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 { -- cgit