making linters happy
Some checks failed
CI / Rust Blocking Checks (push) Failing after 22s
CI / Web Blocking Checks (push) Failing after 26s
CI / Security Blocking Checks (push) Successful in 9s
CI / Web Advisory Checks (push) Successful in 32s
CI / Security Advisory Checks (push) Has been cancelled
Some checks failed
CI / Rust Blocking Checks (push) Failing after 22s
CI / Web Blocking Checks (push) Failing after 26s
CI / Security Blocking Checks (push) Successful in 9s
CI / Web Advisory Checks (push) Successful in 32s
CI / Security Advisory Checks (push) Has been cancelled
This commit is contained in:
@@ -295,7 +295,7 @@ impl Update for ActionRepository {
|
||||
|
||||
query.push(", updated = NOW() WHERE id = ");
|
||||
query.push_bind(id);
|
||||
query.push(&format!(" RETURNING {}", ACTION_COLUMNS));
|
||||
query.push(format!(" RETURNING {}", ACTION_COLUMNS));
|
||||
|
||||
let action = query
|
||||
.build_query_as::<Action>()
|
||||
@@ -554,7 +554,6 @@ impl ActionRepository {
|
||||
}
|
||||
}
|
||||
|
||||
/// Repository for Policy operations
|
||||
// ============================================================================
|
||||
// Policy Repository
|
||||
// ============================================================================
|
||||
|
||||
@@ -47,7 +47,7 @@ pub struct HistoryQueryParams {
|
||||
impl HistoryQueryParams {
|
||||
/// Returns the effective limit, capped at 1000.
|
||||
pub fn effective_limit(&self) -> i64 {
|
||||
self.limit.unwrap_or(100).min(1000).max(1)
|
||||
self.limit.unwrap_or(100).clamp(1, 1000)
|
||||
}
|
||||
|
||||
/// Returns the effective offset.
|
||||
|
||||
@@ -582,7 +582,7 @@ impl EnforcementRepository {
|
||||
}
|
||||
|
||||
if let Some(status) = &filters.status {
|
||||
push_condition!("status = ", status.clone());
|
||||
push_condition!("status = ", *status);
|
||||
}
|
||||
if let Some(rule_id) = filters.rule {
|
||||
push_condition!("rule = ", rule_id);
|
||||
|
||||
@@ -391,7 +391,7 @@ impl ExecutionRepository {
|
||||
}
|
||||
|
||||
if let Some(status) = &filters.status {
|
||||
push_condition!("e.status = ", status.clone());
|
||||
push_condition!("e.status = ", *status);
|
||||
}
|
||||
if let Some(action_ref) = &filters.action_ref {
|
||||
push_condition!("e.action_ref = ", action_ref.clone());
|
||||
|
||||
@@ -129,7 +129,7 @@ impl Update for IdentityRepository {
|
||||
.map_err(|e| {
|
||||
// Convert RowNotFound to NotFound error
|
||||
if matches!(e, sqlx::Error::RowNotFound) {
|
||||
return crate::Error::not_found("identity", "id", &id.to_string());
|
||||
return crate::Error::not_found("identity", "id", id.to_string());
|
||||
}
|
||||
e.into()
|
||||
})
|
||||
|
||||
@@ -211,7 +211,7 @@ impl InquiryRepository {
|
||||
}
|
||||
|
||||
if let Some(status) = &filters.status {
|
||||
push_condition!("status = ", status.clone());
|
||||
push_condition!("status = ", *status);
|
||||
}
|
||||
if let Some(execution_id) = filters.execution {
|
||||
push_condition!("execution = ", execution_id);
|
||||
|
||||
@@ -218,7 +218,7 @@ impl KeyRepository {
|
||||
}
|
||||
|
||||
if let Some(ref owner_type) = filters.owner_type {
|
||||
push_condition!("owner_type = ", owner_type.clone());
|
||||
push_condition!("owner_type = ", *owner_type);
|
||||
}
|
||||
if let Some(ref owner) = filters.owner {
|
||||
push_condition!("owner = ", owner.clone());
|
||||
|
||||
@@ -408,6 +408,7 @@ impl PackRepository {
|
||||
}
|
||||
|
||||
/// Update installation metadata for a pack
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub async fn update_installation_metadata<'e, E>(
|
||||
executor: E,
|
||||
id: i64,
|
||||
|
||||
@@ -239,7 +239,7 @@ impl Update for RuntimeVersionRepository {
|
||||
|
||||
query.push(" WHERE id = ");
|
||||
query.push_bind(id);
|
||||
query.push(&format!(" RETURNING {}", SELECT_COLUMNS));
|
||||
query.push(format!(" RETURNING {}", SELECT_COLUMNS));
|
||||
|
||||
let row = query
|
||||
.build_query_as::<RuntimeVersion>()
|
||||
|
||||
@@ -276,7 +276,7 @@ impl Update for TriggerRepository {
|
||||
.map_err(|e| {
|
||||
// Convert RowNotFound to NotFound error
|
||||
if matches!(e, sqlx::Error::RowNotFound) {
|
||||
return crate::Error::not_found("trigger", "id", &id.to_string());
|
||||
return crate::Error::not_found("trigger", "id", id.to_string());
|
||||
}
|
||||
e.into()
|
||||
})?;
|
||||
|
||||
Reference in New Issue
Block a user