Skip to content

Commit a62f3b5

Browse files
committed
fix: resolve lint issue
1 parent 5324ad2 commit a62f3b5

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

datafusion-postgres/src/hooks/set_show.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -170,16 +170,16 @@ where
170170

171171
client::set_statement_timeout(client, timeout);
172172
return Some(Ok(Response::Execution(Tag::new("SET"))));
173-
} else if matches!(var.as_str(), "datestyle" | "bytea_output" | "intervalstyle") {
174-
if values.len() > 0 {
175-
// postgres configuration variables
176-
let value = values[0].clone();
177-
if let Expr::Value(value) = value {
178-
client
179-
.metadata_mut()
180-
.insert(var, value.into_string().unwrap_or_else(|| "".to_string()));
181-
return Some(Ok(Response::Execution(Tag::new("SET"))));
182-
}
173+
} else if matches!(var.as_str(), "datestyle" | "bytea_output" | "intervalstyle")
174+
&& !values.is_empty()
175+
{
176+
// postgres configuration variables
177+
let value = values[0].clone();
178+
if let Expr::Value(value) = value {
179+
client
180+
.metadata_mut()
181+
.insert(var, value.into_string().unwrap_or_else(|| "".to_string()));
182+
return Some(Ok(Response::Execution(Tag::new("SET"))));
183183
}
184184
}
185185
}
@@ -199,7 +199,7 @@ where
199199
if let Err(e) = execute_set_statement(session_context, statement.clone()).await {
200200
warn!(
201201
"SET statement {} is not supported by datafusion, error {e}, statement ignored",
202-
statement.to_string()
202+
statement
203203
);
204204
}
205205

0 commit comments

Comments
 (0)