From 83cc6e0ca3e9878c47593ab737e6bf106ea062db Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Tue, 21 Nov 2017 20:53:57 +0100 Subject: Apply suggestions from rustfmt to improve style --- askama_shared/src/escaping.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'askama_shared/src/escaping.rs') diff --git a/askama_shared/src/escaping.rs b/askama_shared/src/escaping.rs index 99babfd..896fc2a 100644 --- a/askama_shared/src/escaping.rs +++ b/askama_shared/src/escaping.rs @@ -11,12 +11,12 @@ impl MarkupDisplay where T: Display { pub fn mark_safe(self) -> MarkupDisplay { match self { MarkupDisplay::Unsafe(t) => MarkupDisplay::Safe(t), - _ => { self }, + _ => self, } } pub fn unsafe_string(&self) -> String { match *self { - MarkupDisplay::Safe(ref t) | MarkupDisplay::Unsafe(ref t) => format!("{}", t) + MarkupDisplay::Safe(ref t) | MarkupDisplay::Unsafe(ref t) => format!("{}", t), } } } @@ -30,12 +30,8 @@ impl From for MarkupDisplay where T: Display { impl Display for MarkupDisplay where T: Display { fn fmt(&self, f: &mut Formatter) -> fmt::Result { match *self { - MarkupDisplay::Unsafe(_) => { - write!(f, "{}", escape(self.unsafe_string())) - }, - MarkupDisplay::Safe(ref t) => { - t.fmt(f) - }, + MarkupDisplay::Unsafe(_) => write!(f, "{}", escape(self.unsafe_string())), + MarkupDisplay::Safe(ref t) => t.fmt(f), } } } -- cgit