simplify Display on QuoteKind

This commit is contained in:
ConnorSkees 2020-05-06 12:07:27 -04:00
parent 1b774a9b91
commit edb9dde259

View File

@ -1,4 +1,4 @@
use std::fmt::{self, Display}; use std::fmt::{self, Write, Display};
#[derive(Copy, Clone, Debug, Eq, PartialEq)] #[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub enum Op { pub enum Op {
@ -71,8 +71,8 @@ impl Display for QuoteKind {
#[inline] #[inline]
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self { match self {
Self::Quoted => write!(f, "\""), Self::Quoted => f.write_char('"'),
Self::None => write!(f, ""), Self::None => Ok(()),
} }
} }
} }