Skip to content

Commit c207b4f

Browse files
committed
fix: resolves lint issues
1 parent 00088f9 commit c207b4f

File tree

5 files changed

+10
-12
lines changed

5 files changed

+10
-12
lines changed

arrow-pg/src/datatypes/df.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ where
160160
return Err(PgWireError::UserError(Box::new(ErrorInfo::new(
161161
"FATAL".to_string(),
162162
"XX000".to_string(),
163-
format!("Unsupported parameter type: {}", pg_type),
163+
format!("Unsupported parameter type: {pg_type}"),
164164
))));
165165
}
166166
}

arrow-pg/src/encoder.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -496,8 +496,7 @@ pub fn encode_value<T: Encoder>(
496496
postgres_types::Kind::Composite(fields) => fields,
497497
_ => {
498498
return Err(PgWireError::ApiError(ToSqlError::from(format!(
499-
"Failed to unwrap a composite type from type {}",
500-
type_
499+
"Failed to unwrap a composite type from type {type_}"
501500
))));
502501
}
503502
};
@@ -529,8 +528,7 @@ pub fn encode_value<T: Encoder>(
529528
.or_else(|| get_dict_values!(UInt64Type))
530529
.ok_or_else(|| {
531530
ToSqlError::from(format!(
532-
"Unsupported dictionary key type for value type {}",
533-
value_type
531+
"Unsupported dictionary key type for value type {value_type}",
534532
))
535533
})?;
536534

datafusion-postgres/src/handlers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ impl DfSessionService {
156156
pgwire::error::ErrorInfo::new(
157157
"ERROR".to_string(),
158158
"42704".to_string(),
159-
format!("Unrecognized SHOW command: {}", query_lower),
159+
format!("Unrecognized SHOW command: {query_lower}"),
160160
),
161161
))),
162162
}

datafusion-postgres/src/lib.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use std::sync::Arc;
55

66
use datafusion::prelude::SessionContext;
77
use getset::{Getters, Setters, WithSetters};
8+
use log::{info, warn};
89
use pgwire::tokio::process_socket;
910
use tokio::net::TcpListener;
1011

@@ -46,23 +47,23 @@ pub async fn serve(
4647
// Bind to the specified host and port
4748
let server_addr = format!("{}:{}", opts.host, opts.port);
4849
let listener = TcpListener::bind(&server_addr).await?;
49-
println!("Listening on {}", server_addr);
50+
info!("Listening on {}", server_addr);
5051

5152
// Accept incoming connections
5253
loop {
5354
match listener.accept().await {
5455
Ok((socket, addr)) => {
5556
let factory_ref = factory.clone();
56-
println!("Accepted connection from {}", addr);
57+
info!("Accepted connection from {addr}");
5758

5859
tokio::spawn(async move {
5960
if let Err(e) = process_socket(socket, None, factory_ref).await {
60-
eprintln!("Error processing socket: {}", e);
61+
warn!("Error processing socket: {e}");
6162
}
6263
});
6364
}
6465
Err(e) => {
65-
eprintln!("Error accept socket: {}", e);
66+
info!("Error accept socket: {e}");
6667
}
6768
}
6869
}

datafusion-postgres/src/pg_catalog.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -662,8 +662,7 @@ pub fn setup_pg_catalog(
662662
.catalog(catalog_name)
663663
.ok_or_else(|| {
664664
DataFusionError::Configuration(format!(
665-
"Catalog not found when registering pg_catalog: {}",
666-
catalog_name
665+
"Catalog not found when registering pg_catalog: {catalog_name}",
667666
))
668667
})?
669668
.register_schema("pg_catalog", Arc::new(pg_catalog))?;

0 commit comments

Comments
 (0)