Skip to content

Commit

Permalink
refactor(cubesql): Fix to_string_in_format_args warning
Browse files Browse the repository at this point in the history
  • Loading branch information
mcheshkov committed Dec 20, 2024
1 parent 3b57a8d commit 515d19c
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 11 deletions.
1 change: 0 additions & 1 deletion rust/cubesql/cubesql/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ redundant_pattern_matching = "allow"
result_large_err = "allow"
single_match = "allow"
should_implement_trait = "allow"
to_string_in_format_args = "allow"
to_string_trait_impl = "allow"
too_many_arguments = "allow"
type_complexity = "allow"
Expand Down
5 changes: 1 addition & 4 deletions rust/cubesql/cubesql/src/compile/engine/udf/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1564,10 +1564,7 @@ pub fn create_str_to_date_udf() -> ScalarUDF {

let res = NaiveDateTime::parse_from_str(timestamp, &format).map_err(|e| {
DataFusionError::Execution(format!(
"Error evaluating str_to_date('{}', '{}'): {}",
timestamp,
format,
e.to_string()
"Error evaluating str_to_date('{timestamp}', '{format}'): {e}"

Check warning on line 1567 in rust/cubesql/cubesql/src/compile/engine/udf/common.rs

View check run for this annotation

Codecov / codecov/patch

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

Added line #L1567 was not covered by tests
))
})?;

Expand Down
2 changes: 1 addition & 1 deletion rust/cubesql/cubesql/src/compile/rewrite/analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ impl LogicalPlanAnalysis {
.unwrap();
let expr = original_expr(params[2])?;
map.push((
Some(format!("{}.{}", cube, field_name.to_string())),
Some(format!("{cube}.{field_name}")),
Member::VirtualField {
name: field_name.to_string(),
cube: cube.to_string(),
Expand Down
3 changes: 1 addition & 2 deletions rust/cubesql/cubesql/src/compile/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,7 @@ impl QueryRouter {
DatabaseProtocol::PostgreSQL,
) if object_type == &ast::ObjectType::Table => self.drop_table_to_plan(names).await,
_ => Err(CompilationError::unsupported(format!(
"Unsupported query type: {}",
stmt.to_string()
"Unsupported query type: {stmt}"
))),
};

Expand Down
4 changes: 1 addition & 3 deletions rust/cubesql/cubesql/src/sql/statement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -480,9 +480,7 @@ trait Visitor<'ast, E: Error> {
ConnectionError::from(ErrorResponse::error(
ErrorCode::SyntaxError,
format!(
"Unable to extract position for placeholder, actual: {}, err: {}",
name,
err.to_string()
"Unable to extract position for placeholder, actual: {name}, err: {err}"

Check warning on line 483 in rust/cubesql/cubesql/src/sql/statement.rs

View check run for this annotation

Codecov / codecov/patch

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

Added line #L483 was not covered by tests
),
))
})?;
Expand Down

0 comments on commit 515d19c

Please sign in to comment.