chore: enable clippy::trivially_copy_pass_by_ref lint and address it (#6724)

This commit is contained in:
Sanchith Hegde
2024-12-05 20:11:40 +05:30
committed by GitHub
parent e5dde6acc0
commit d17d2fe075
154 changed files with 423 additions and 429 deletions

View File

@ -118,7 +118,7 @@ pub async fn get_api_event_metrics(
&req.group_by_names.clone(),
&merchant_id_scoped,
&req.filters,
&req.time_series.map(|t| t.granularity),
req.time_series.map(|t| t.granularity),
&req.time_range,
)
.await

View File

@ -45,7 +45,7 @@ where
dimensions: &[ApiEventDimensions],
merchant_id: &common_utils::id_type::MerchantId,
filters: &ApiEventFilters,
granularity: &Option<Granularity>,
granularity: Option<Granularity>,
time_range: &TimeRange,
pool: &T,
) -> MetricsResult<HashSet<(ApiEventMetricsBucketIdentifier, ApiEventMetricRow)>>;
@ -66,7 +66,7 @@ where
dimensions: &[ApiEventDimensions],
merchant_id: &common_utils::id_type::MerchantId,
filters: &ApiEventFilters,
granularity: &Option<Granularity>,
granularity: Option<Granularity>,
time_range: &TimeRange,
pool: &T,
) -> MetricsResult<HashSet<(ApiEventMetricsBucketIdentifier, ApiEventMetricRow)>> {

View File

@ -32,7 +32,7 @@ where
_dimensions: &[ApiEventDimensions],
merchant_id: &common_utils::id_type::MerchantId,
filters: &ApiEventFilters,
granularity: &Option<Granularity>,
granularity: Option<Granularity>,
time_range: &TimeRange,
pool: &T,
) -> MetricsResult<HashSet<(ApiEventMetricsBucketIdentifier, ApiEventMetricRow)>> {
@ -62,7 +62,7 @@ where
alias: Some("end_bucket"),
})
.switch()?;
if let Some(granularity) = granularity.as_ref() {
if let Some(granularity) = granularity {
granularity
.set_group_by_clause(&mut query_builder)
.attach_printable("Error adding granularity")

View File

@ -35,7 +35,7 @@ where
_dimensions: &[ApiEventDimensions],
merchant_id: &common_utils::id_type::MerchantId,
filters: &ApiEventFilters,
granularity: &Option<Granularity>,
granularity: Option<Granularity>,
time_range: &TimeRange,
pool: &T,
) -> MetricsResult<HashSet<(ApiEventMetricsBucketIdentifier, ApiEventMetricRow)>> {
@ -67,7 +67,7 @@ where
alias: Some("end_bucket"),
})
.switch()?;
if let Some(granularity) = granularity.as_ref() {
if let Some(granularity) = granularity {
granularity
.set_group_by_clause(&mut query_builder)
.attach_printable("Error adding granularity")

View File

@ -32,7 +32,7 @@ where
_dimensions: &[ApiEventDimensions],
merchant_id: &common_utils::id_type::MerchantId,
filters: &ApiEventFilters,
granularity: &Option<Granularity>,
granularity: Option<Granularity>,
time_range: &TimeRange,
pool: &T,
) -> MetricsResult<HashSet<(ApiEventMetricsBucketIdentifier, ApiEventMetricRow)>> {
@ -68,7 +68,7 @@ where
alias: Some("end_bucket"),
})
.switch()?;
if let Some(granularity) = granularity.as_ref() {
if let Some(granularity) = granularity {
granularity
.set_group_by_clause(&mut query_builder)
.attach_printable("Error adding granularity")