Skip to content

Commit 1fd6ca0

Browse files
committed
refactor(cubesql): Fix to_string_in_format_args warning
1 parent 37ed344 commit 1fd6ca0

File tree

5 files changed

+4
-11
lines changed

5 files changed

+4
-11
lines changed

rust/cubesql/cubesql/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ redundant_pattern_matching = "allow"
137137
result_large_err = "allow"
138138
single_match = "allow"
139139
should_implement_trait = "allow"
140-
to_string_in_format_args = "allow"
141140
to_string_trait_impl = "allow"
142141
too_many_arguments = "allow"
143142
type_complexity = "allow"

rust/cubesql/cubesql/src/compile/engine/udf/common.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1564,10 +1564,7 @@ pub fn create_str_to_date_udf() -> ScalarUDF {
15641564

15651565
let res = NaiveDateTime::parse_from_str(timestamp, &format).map_err(|e| {
15661566
DataFusionError::Execution(format!(
1567-
"Error evaluating str_to_date('{}', '{}'): {}",
1568-
timestamp,
1569-
format,
1570-
e.to_string()
1567+
"Error evaluating str_to_date('{timestamp}', '{format}'): {e}"
15711568
))
15721569
})?;
15731570

rust/cubesql/cubesql/src/compile/rewrite/analysis.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ impl LogicalPlanAnalysis {
551551
.unwrap();
552552
let expr = original_expr(params[2])?;
553553
map.push((
554-
Some(format!("{}.{}", cube, field_name.to_string())),
554+
Some(format!("{cube}.{field_name}")),
555555
Member::VirtualField {
556556
name: field_name.to_string(),
557557
cube: cube.to_string(),

rust/cubesql/cubesql/src/compile/router.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,7 @@ impl QueryRouter {
168168
DatabaseProtocol::PostgreSQL,
169169
) if object_type == &ast::ObjectType::Table => self.drop_table_to_plan(names).await,
170170
_ => Err(CompilationError::unsupported(format!(
171-
"Unsupported query type: {}",
172-
stmt.to_string()
171+
"Unsupported query type: {stmt}"
173172
))),
174173
};
175174

rust/cubesql/cubesql/src/sql/statement.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -480,9 +480,7 @@ trait Visitor<'ast, E: Error> {
480480
ConnectionError::from(ErrorResponse::error(
481481
ErrorCode::SyntaxError,
482482
format!(
483-
"Unable to extract position for placeholder, actual: {}, err: {}",
484-
name,
485-
err.to_string()
483+
"Unable to extract position for placeholder, actual: {name}, err: {err}"
486484
),
487485
))
488486
})?;

0 commit comments

Comments
 (0)