Skip to content

Commit 70697d8

Browse files
authored
fix: lint (#193)
1 parent 18d369a commit 70697d8

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

datafusion-postgres/src/pg_catalog/format_type.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ fn format_postgres_type(type_oid: i32, typemod: i32) -> String {
118118
let precision = ((typemod - 4) >> 16) & 0xffff;
119119
let scale = (typemod - 4) & 0xffff;
120120
if scale > 0 {
121-
format!("numeric({},{})", precision, scale)
121+
format!("numeric({precision},{scale})")
122122
} else {
123-
format!("numeric({})", precision)
123+
format!("numeric({precision})")
124124
}
125125
} else {
126126
"numeric".to_string()
@@ -132,31 +132,31 @@ fn format_postgres_type(type_oid: i32, typemod: i32) -> String {
132132
1083 => {
133133
// time without time zone
134134
if typemod >= 0 {
135-
format!("time({}) without time zone", typemod)
135+
format!("time({typemod}) without time zone")
136136
} else {
137137
"time without time zone".to_string()
138138
}
139139
}
140140
1114 => {
141141
// timestamp without time zone
142142
if typemod >= 0 {
143-
format!("timestamp({}) without time zone", typemod)
143+
format!("timestamp({typemod}) without time zone")
144144
} else {
145145
"timestamp without time zone".to_string()
146146
}
147147
}
148148
1184 => {
149149
// timestamp with time zone
150150
if typemod >= 0 {
151-
format!("timestamp({}) with time zone", typemod)
151+
format!("timestamp({typemod}) with time zone")
152152
} else {
153153
"timestamp with time zone".to_string()
154154
}
155155
}
156156
1266 => {
157157
// time with time zone
158158
if typemod >= 0 {
159-
format!("time({}) with time zone", typemod)
159+
format!("time({typemod}) with time zone")
160160
} else {
161161
"time with time zone".to_string()
162162
}
@@ -167,15 +167,15 @@ fn format_postgres_type(type_oid: i32, typemod: i32) -> String {
167167
1560 => {
168168
// bit
169169
if typemod > 0 {
170-
format!("bit({})", typemod)
170+
format!("bit({typemod})",)
171171
} else {
172172
"bit".to_string()
173173
}
174174
}
175175
1562 => {
176176
// bit varying
177177
if typemod > 0 {
178-
format!("bit varying({})", typemod)
178+
format!("bit varying({typemod})")
179179
} else {
180180
"bit varying".to_string()
181181
}
@@ -191,12 +191,12 @@ fn format_postgres_type(type_oid: i32, typemod: i32) -> String {
191191
if let Some(base_oid) = get_array_base_type(oid) {
192192
format!("{}[]", format_postgres_type(base_oid, -1))
193193
} else {
194-
format!("oid({})", oid)
194+
format!("oid({oid})")
195195
}
196196
}
197197

198198
// Unknown or invalid OID
199-
_ => format!("oid({})", type_oid),
199+
_ => format!("oid({type_oid})"),
200200
}
201201
}
202202

0 commit comments

Comments
 (0)