Skip to content

Commit ac8ba10

Browse files
committed
Simplify Display implementations introduced in apache#124
1 parent 1b31f03 commit ac8ba10

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/ast/mod.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,9 @@ pub enum Expr {
165165
impl fmt::Display for Expr {
166166
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
167167
match self {
168-
Expr::Identifier(s) => write!(f, "{}", s),
168+
Expr::Identifier(s) => f.write_str(s),
169169
Expr::Wildcard => f.write_str("*"),
170-
Expr::QualifiedWildcard(q) => {
171-
write!(f, "{}", display_separated(q, "."))?;
172-
f.write_str(".*")
173-
}
170+
Expr::QualifiedWildcard(q) => write!(f, "{}.*", display_separated(q, ".")),
174171
Expr::CompoundIdentifier(s) => write!(f, "{}", display_separated(s, ".")),
175172
Expr::IsNull(ast) => write!(f, "{} IS NULL", ast),
176173
Expr::IsNotNull(ast) => write!(f, "{} IS NOT NULL", ast),
@@ -732,7 +729,7 @@ impl fmt::Display for TransactionMode {
732729
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
733730
use TransactionMode::*;
734731
match self {
735-
AccessMode(access_mode) => write!(f, "{}", access_mode.to_string()),
732+
AccessMode(access_mode) => write!(f, "{}", access_mode),
736733
IsolationLevel(iso_level) => write!(f, "ISOLATION LEVEL {}", iso_level),
737734
}
738735
}

0 commit comments

Comments
 (0)