mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-09-25 06:59:15 +00:00
Simplify Display implementations introduced in #124
This commit is contained in:
parent
1b31f03732
commit
ac8ba107e3
1 changed files with 3 additions and 6 deletions
|
@ -165,12 +165,9 @@ pub enum Expr {
|
||||||
impl fmt::Display for Expr {
|
impl fmt::Display for Expr {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
match self {
|
match self {
|
||||||
Expr::Identifier(s) => write!(f, "{}", s),
|
Expr::Identifier(s) => f.write_str(s),
|
||||||
Expr::Wildcard => f.write_str("*"),
|
Expr::Wildcard => f.write_str("*"),
|
||||||
Expr::QualifiedWildcard(q) => {
|
Expr::QualifiedWildcard(q) => write!(f, "{}.*", display_separated(q, ".")),
|
||||||
write!(f, "{}", display_separated(q, "."))?;
|
|
||||||
f.write_str(".*")
|
|
||||||
}
|
|
||||||
Expr::CompoundIdentifier(s) => write!(f, "{}", display_separated(s, ".")),
|
Expr::CompoundIdentifier(s) => write!(f, "{}", display_separated(s, ".")),
|
||||||
Expr::IsNull(ast) => write!(f, "{} IS NULL", ast),
|
Expr::IsNull(ast) => write!(f, "{} IS NULL", ast),
|
||||||
Expr::IsNotNull(ast) => write!(f, "{} IS NOT NULL", ast),
|
Expr::IsNotNull(ast) => write!(f, "{} IS NOT NULL", ast),
|
||||||
|
@ -732,7 +729,7 @@ impl fmt::Display for TransactionMode {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
use TransactionMode::*;
|
use TransactionMode::*;
|
||||||
match self {
|
match self {
|
||||||
AccessMode(access_mode) => write!(f, "{}", access_mode.to_string()),
|
AccessMode(access_mode) => write!(f, "{}", access_mode),
|
||||||
IsolationLevel(iso_level) => write!(f, "ISOLATION LEVEL {}", iso_level),
|
IsolationLevel(iso_level) => write!(f, "ISOLATION LEVEL {}", iso_level),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue