clippy pleaser

This commit is contained in:
lda
2026-05-03 15:47:16 +07:00 Verified
parent 3f8abc1571
commit 7e8e1fca23
8 changed files with 22 additions and 21 deletions
+4 -4
View File
@@ -84,7 +84,7 @@ pub async fn alert_history(
ApiError::new(
StatusCode::INTERNAL_SERVER_ERROR,
"alert_history_failed",
&err.to_string(),
err.to_string(),
)
})?;
@@ -185,7 +185,7 @@ async fn evaluate_alerts(
ApiError::new(
StatusCode::INTERNAL_SERVER_ERROR,
"alerts_query_failed",
&err.to_string(),
err.to_string(),
)
})?;
@@ -204,7 +204,7 @@ async fn evaluate_alerts(
ApiError::new(
StatusCode::INTERNAL_SERVER_ERROR,
"alerts_query_failed",
&err.to_string(),
err.to_string(),
)
})?;
@@ -223,7 +223,7 @@ async fn evaluate_alerts(
ApiError::new(
StatusCode::INTERNAL_SERVER_ERROR,
"alerts_query_failed",
&err.to_string(),
err.to_string(),
)
})?;
+1 -1
View File
@@ -74,7 +74,7 @@ pub async fn list_audit_events(
Err(ApiError::new(
StatusCode::INTERNAL_SERVER_ERROR,
"list_audit_events_failed",
&err.to_string(),
err.to_string(),
))
}
}
+1 -1
View File
@@ -152,7 +152,7 @@ pub async fn relay_agent_command(
return Err(ApiError::new(
StatusCode::BAD_GATEWAY,
"agent_send_failed",
&format!("failed to send command to agent: {err}"),
format!("failed to send command to agent: {err}"),
));
}
@@ -81,7 +81,7 @@ pub async fn create_known_device(
Err(ApiError::new(
StatusCode::BAD_REQUEST,
"create_known_device_failed",
&err.to_string(),
err.to_string(),
))
}
}
@@ -105,7 +105,7 @@ pub async fn list_known_devices(
Err(ApiError::new(
StatusCode::INTERNAL_SERVER_ERROR,
"list_known_devices_failed",
&err.to_string(),
err.to_string(),
))
}
}
@@ -128,7 +128,7 @@ pub async fn forget_known_device(
Err(ApiError::new(
StatusCode::INTERNAL_SERVER_ERROR,
"forget_known_device_failed",
&err.to_string(),
err.to_string(),
))
}
}
@@ -160,7 +160,7 @@ pub async fn attach_device_identifier(
Err(ApiError::new(
StatusCode::BAD_REQUEST,
"attach_device_identifier_failed",
&err.to_string(),
err.to_string(),
))
}
}
@@ -186,7 +186,7 @@ pub async fn detach_device_identifier(
Err(ApiError::new(
StatusCode::BAD_REQUEST,
"detach_device_identifier_failed",
&err.to_string(),
err.to_string(),
))
}
}
@@ -213,7 +213,7 @@ pub async fn merge_known_device(
Err(ApiError::new(
StatusCode::BAD_REQUEST,
"merge_known_device_failed",
&err.to_string(),
err.to_string(),
))
}
}
@@ -122,7 +122,7 @@ pub async fn enroll(
Err(ApiError::new(
StatusCode::UNAUTHORIZED,
"enrollment_rejected",
&err.to_string(),
err.to_string(),
))
}
}
@@ -178,7 +178,7 @@ pub async fn issue_enroll_token(
Err(ApiError::new(
StatusCode::INTERNAL_SERVER_ERROR,
"issue_enroll_token_failed",
&err.to_string(),
err.to_string(),
))
}
}
@@ -223,7 +223,7 @@ pub async fn list_enroll_tokens(
Err(ApiError::new(
StatusCode::INTERNAL_SERVER_ERROR,
"list_enroll_tokens_failed",
&err.to_string(),
err.to_string(),
))
}
}
@@ -270,7 +270,7 @@ pub async fn revoke_enroll_token(
Err(ApiError::new(
StatusCode::INTERNAL_SERVER_ERROR,
"revoke_enroll_token_failed",
&err.to_string(),
err.to_string(),
))
}
}
@@ -325,7 +325,7 @@ pub async fn revoke_agent(
Err(ApiError::new(
StatusCode::INTERNAL_SERVER_ERROR,
"revoke_agent_failed",
&err.to_string(),
err.to_string(),
))
}
}
@@ -392,7 +392,7 @@ pub async fn set_agent_nickname(
Err(ApiError::new(
StatusCode::INTERNAL_SERVER_ERROR,
"set_agent_nickname_failed",
&err.to_string(),
err.to_string(),
))
}
}
@@ -37,7 +37,7 @@ pub async fn list_fleet_devices(
Err(ApiError::new(
StatusCode::INTERNAL_SERVER_ERROR,
"list_fleet_devices_failed",
&err.to_string(),
err.to_string(),
))
}
}
@@ -166,7 +166,7 @@ pub async fn wake_fleet_device(
ApiError::new(
StatusCode::INTERNAL_SERVER_ERROR,
"load_fleet_devices_failed",
&err.to_string(),
err.to_string(),
)
})?;
+1 -1
View File
@@ -34,7 +34,7 @@ pub async fn state_stats(State(state): State<AppState>) -> Result<impl IntoRespo
Err(ApiError::new(
StatusCode::INTERNAL_SERVER_ERROR,
"state_stats_failed",
&err.to_string(),
err.to_string(),
))
}
}
+1
View File
@@ -51,6 +51,7 @@ impl ApiError {
}
}
#[allow(dead_code)]
pub fn with_details(mut self, details: serde_json::Value) -> Self {
self.details = Some(details);
self