mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-09-25 06:59:15 +00:00
Reduce nesting of if
s in SQLType::Decimal::to_string()
This commit is contained in:
parent
451513db5b
commit
5263ee1e9e
1 changed files with 3 additions and 5 deletions
|
@ -76,12 +76,10 @@ impl ToString for SQLType {
|
||||||
SQLType::Decimal(precision, scale) => {
|
SQLType::Decimal(precision, scale) => {
|
||||||
if let Some(scale) = scale {
|
if let Some(scale) = scale {
|
||||||
format!("numeric({},{})", precision.unwrap(), scale)
|
format!("numeric({},{})", precision.unwrap(), scale)
|
||||||
|
} else if let Some(precision) = precision {
|
||||||
|
format!("numeric({})", precision)
|
||||||
} else {
|
} else {
|
||||||
if let Some(precision) = precision {
|
format!("numeric")
|
||||||
format!("numeric({})", precision)
|
|
||||||
} else {
|
|
||||||
format!("numeric")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SQLType::SmallInt => "smallint".to_string(),
|
SQLType::SmallInt => "smallint".to_string(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue