From edb9dde2599a61ed9da78e26469a443a8e318269 Mon Sep 17 00:00:00 2001 From: ConnorSkees <39542938+ConnorSkees@users.noreply.github.com> Date: Wed, 6 May 2020 12:07:27 -0400 Subject: [PATCH] simplify Display on QuoteKind --- src/common.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common.rs b/src/common.rs index 1421e45..86ad1b2 100644 --- a/src/common.rs +++ b/src/common.rs @@ -1,4 +1,4 @@ -use std::fmt::{self, Display}; +use std::fmt::{self, Write, Display}; #[derive(Copy, Clone, Debug, Eq, PartialEq)] pub enum Op { @@ -71,8 +71,8 @@ impl Display for QuoteKind { #[inline] fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { - Self::Quoted => write!(f, "\""), - Self::None => write!(f, ""), + Self::Quoted => f.write_char('"'), + Self::None => Ok(()), } } }