mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 01:27:31 +08:00
chore: address Rust 1.88.0 clippy lints (#8498)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -502,7 +502,7 @@ where
|
||||
};
|
||||
format!(
|
||||
"{query}{}",
|
||||
alias.map_or_else(|| "".to_owned(), |alias| format!(" as {}", alias))
|
||||
alias.map_or_else(|| "".to_owned(), |alias| format!(" as {alias}"))
|
||||
)
|
||||
}
|
||||
Self::Sum { field, alias } => {
|
||||
@ -522,7 +522,7 @@ where
|
||||
};
|
||||
format!(
|
||||
"{query}{}",
|
||||
alias.map_or_else(|| "".to_owned(), |alias| format!(" as {}", alias))
|
||||
alias.map_or_else(|| "".to_owned(), |alias| format!(" as {alias}"))
|
||||
)
|
||||
}
|
||||
Self::Min { field, alias } => {
|
||||
@ -531,7 +531,7 @@ where
|
||||
field
|
||||
.to_sql(table_engine)
|
||||
.attach_printable("Failed to min aggregate")?,
|
||||
alias.map_or_else(|| "".to_owned(), |alias| format!(" as {}", alias))
|
||||
alias.map_or_else(|| "".to_owned(), |alias| format!(" as {alias}"))
|
||||
)
|
||||
}
|
||||
Self::Max { field, alias } => {
|
||||
@ -540,7 +540,7 @@ where
|
||||
field
|
||||
.to_sql(table_engine)
|
||||
.attach_printable("Failed to max aggregate")?,
|
||||
alias.map_or_else(|| "".to_owned(), |alias| format!(" as {}", alias))
|
||||
alias.map_or_else(|| "".to_owned(), |alias| format!(" as {alias}"))
|
||||
)
|
||||
}
|
||||
Self::Percentile {
|
||||
@ -554,7 +554,7 @@ where
|
||||
field
|
||||
.to_sql(table_engine)
|
||||
.attach_printable("Failed to percentile aggregate")?,
|
||||
alias.map_or_else(|| "".to_owned(), |alias| format!(" as {}", alias))
|
||||
alias.map_or_else(|| "".to_owned(), |alias| format!(" as {alias}"))
|
||||
)
|
||||
}
|
||||
Self::DistinctCount { field, alias } => {
|
||||
@ -563,7 +563,7 @@ where
|
||||
field
|
||||
.to_sql(table_engine)
|
||||
.attach_printable("Failed to percentile aggregate")?,
|
||||
alias.map_or_else(|| "".to_owned(), |alias| format!(" as {}", alias))
|
||||
alias.map_or_else(|| "".to_owned(), |alias| format!(" as {alias}"))
|
||||
)
|
||||
}
|
||||
})
|
||||
@ -599,7 +599,7 @@ where
|
||||
order
|
||||
)
|
||||
),
|
||||
alias.map_or_else(|| "".to_owned(), |alias| format!(" as {}", alias))
|
||||
alias.map_or_else(|| "".to_owned(), |alias| format!(" as {alias}"))
|
||||
)
|
||||
}
|
||||
Self::RowNumber {
|
||||
@ -622,7 +622,7 @@ where
|
||||
order
|
||||
)
|
||||
),
|
||||
alias.map_or_else(|| "".to_owned(), |alias| format!(" as {}", alias))
|
||||
alias.map_or_else(|| "".to_owned(), |alias| format!(" as {alias}"))
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
@ -107,7 +107,7 @@ impl std::fmt::Display for AnalyticsProvider {
|
||||
Self::CombinedSqlx(_, _) => "CombinedSqlx",
|
||||
};
|
||||
|
||||
write!(f, "{}", analytics_provider)
|
||||
write!(f, "{analytics_provider}")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -143,7 +143,7 @@ impl ErrorSwitch<ApiErrorResponse> for OpenSearchError {
|
||||
Self::ResponseNotOK(response) => ApiErrorResponse::InternalServerError(ApiError::new(
|
||||
"IR",
|
||||
1,
|
||||
format!("Something went wrong {}", response),
|
||||
format!("Something went wrong {response}"),
|
||||
None,
|
||||
)),
|
||||
Self::ResponseError => ApiErrorResponse::InternalServerError(ApiError::new(
|
||||
|
||||
@ -77,7 +77,7 @@ where
|
||||
.switch()?;
|
||||
|
||||
outer_query_builder
|
||||
.add_select_column(format!("({}) AS total", inner_query_string))
|
||||
.add_select_column(format!("({inner_query_string}) AS total"))
|
||||
.switch()?;
|
||||
|
||||
outer_query_builder
|
||||
|
||||
@ -737,7 +737,7 @@ where
|
||||
.change_context(QueryBuildingError::SqlSerializeError)
|
||||
.attach_printable("Error serializing order direction")?;
|
||||
|
||||
self.order_by.push(format!("{} {}", column_sql, order_sql));
|
||||
self.order_by.push(format!("{column_sql} {order_sql}"));
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@ -892,7 +892,7 @@ where
|
||||
}
|
||||
|
||||
if let Some(limit_by) = &self.limit_by {
|
||||
query.push_str(&format!(" {}", limit_by));
|
||||
query.push_str(&format!(" {limit_by}"));
|
||||
}
|
||||
|
||||
if !self.outer_select.is_empty() {
|
||||
|
||||
@ -77,7 +77,7 @@ where
|
||||
.switch()?;
|
||||
|
||||
outer_query_builder
|
||||
.add_select_column(format!("({}) AS total", inner_query_string))
|
||||
.add_select_column(format!("({inner_query_string}) AS total"))
|
||||
.switch()?;
|
||||
|
||||
outer_query_builder
|
||||
|
||||
@ -76,7 +76,7 @@ where
|
||||
.switch()?;
|
||||
|
||||
outer_query_builder
|
||||
.add_select_column(format!("({}) AS total", inner_query_string))
|
||||
.add_select_column(format!("({inner_query_string}) AS total"))
|
||||
.switch()?;
|
||||
|
||||
outer_query_builder
|
||||
|
||||
@ -1434,7 +1434,7 @@ where
|
||||
Self::Count { field: _, alias } => {
|
||||
format!(
|
||||
"count(*){}",
|
||||
alias.map_or_else(|| "".to_owned(), |alias| format!(" as {}", alias))
|
||||
alias.map_or_else(|| "".to_owned(), |alias| format!(" as {alias}"))
|
||||
)
|
||||
}
|
||||
Self::Sum { field, alias } => {
|
||||
@ -1443,7 +1443,7 @@ where
|
||||
field
|
||||
.to_sql(table_engine)
|
||||
.attach_printable("Failed to sum aggregate")?,
|
||||
alias.map_or_else(|| "".to_owned(), |alias| format!(" as {}", alias))
|
||||
alias.map_or_else(|| "".to_owned(), |alias| format!(" as {alias}"))
|
||||
)
|
||||
}
|
||||
Self::Min { field, alias } => {
|
||||
@ -1452,7 +1452,7 @@ where
|
||||
field
|
||||
.to_sql(table_engine)
|
||||
.attach_printable("Failed to min aggregate")?,
|
||||
alias.map_or_else(|| "".to_owned(), |alias| format!(" as {}", alias))
|
||||
alias.map_or_else(|| "".to_owned(), |alias| format!(" as {alias}"))
|
||||
)
|
||||
}
|
||||
Self::Max { field, alias } => {
|
||||
@ -1461,7 +1461,7 @@ where
|
||||
field
|
||||
.to_sql(table_engine)
|
||||
.attach_printable("Failed to max aggregate")?,
|
||||
alias.map_or_else(|| "".to_owned(), |alias| format!(" as {}", alias))
|
||||
alias.map_or_else(|| "".to_owned(), |alias| format!(" as {alias}"))
|
||||
)
|
||||
}
|
||||
Self::Percentile {
|
||||
@ -1475,7 +1475,7 @@ where
|
||||
field
|
||||
.to_sql(table_engine)
|
||||
.attach_printable("Failed to percentile aggregate")?,
|
||||
alias.map_or_else(|| "".to_owned(), |alias| format!(" as {}", alias))
|
||||
alias.map_or_else(|| "".to_owned(), |alias| format!(" as {alias}"))
|
||||
)
|
||||
}
|
||||
Self::DistinctCount { field, alias } => {
|
||||
@ -1484,7 +1484,7 @@ where
|
||||
field
|
||||
.to_sql(table_engine)
|
||||
.attach_printable("Failed to distinct count aggregate")?,
|
||||
alias.map_or_else(|| "".to_owned(), |alias| format!(" as {}", alias))
|
||||
alias.map_or_else(|| "".to_owned(), |alias| format!(" as {alias}"))
|
||||
)
|
||||
}
|
||||
})
|
||||
@ -1520,7 +1520,7 @@ where
|
||||
order
|
||||
)
|
||||
),
|
||||
alias.map_or_else(|| "".to_owned(), |alias| format!(" as {}", alias))
|
||||
alias.map_or_else(|| "".to_owned(), |alias| format!(" as {alias}"))
|
||||
)
|
||||
}
|
||||
Self::RowNumber {
|
||||
@ -1543,7 +1543,7 @@ where
|
||||
order
|
||||
)
|
||||
),
|
||||
alias.map_or_else(|| "".to_owned(), |alias| format!(" as {}", alias))
|
||||
alias.map_or_else(|| "".to_owned(), |alias| format!(" as {alias}"))
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user