Fix Rust derive attribute ordering: move #[serde] after #[derive]

The legacy_derive_helpers lint requires derive helper attributes
(like #[serde(...)]) to appear AFTER the #[derive(...)] that
introduces them, not before. Swapped ordering on all 27 structs
in proxmox.rs and lib.rs.
This commit is contained in:
Matt
2026-07-29 19:42:05 +00:00
parent 3aceaca2e1
commit 7bb3ba48f0
2 changed files with 27 additions and 27 deletions
+7 -7
View File
@@ -16,8 +16,8 @@ use websocket::WebSocketManager;
pub type Result<T> = std::result::Result<T, Error>; pub type Result<T> = std::result::Result<T, Error>;
#[serde(rename_all = "camelCase")]
#[derive(Clone, Serialize, Deserialize)] #[derive(Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ConnectionConfig { pub struct ConnectionConfig {
pub id: String, pub id: String,
pub name: String, pub name: String,
@@ -32,24 +32,24 @@ pub struct ConnectionConfig {
pub username: Option<String>, pub username: Option<String>,
} }
#[serde(rename_all = "camelCase")]
#[derive(Clone, Serialize, Deserialize)] #[derive(Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct EndpointConfig { pub struct EndpointConfig {
pub url: String, pub url: String,
pub node: Option<String>, pub node: Option<String>,
pub token: Option<String>, pub token: Option<String>,
} }
#[serde(rename_all = "camelCase")]
#[derive(Clone, Serialize, Deserialize)] #[derive(Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct LoginResult { pub struct LoginResult {
pub connection_id: String, pub connection_id: String,
pub ticket: String, pub ticket: String,
pub csrf_token: String, pub csrf_token: String,
} }
#[serde(rename_all = "camelCase")]
#[derive(Clone, Serialize, Deserialize)] #[derive(Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct CertificateInfo { pub struct CertificateInfo {
pub fingerprint: String, pub fingerprint: String,
pub issuer: String, pub issuer: String,
@@ -461,16 +461,16 @@ async fn get_stored_credentials(
} }
// Console proxy types // Console proxy types
#[serde(rename_all = "camelCase")]
#[derive(Clone, Serialize, Deserialize)] #[derive(Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct VNCProxyResponse { pub struct VNCProxyResponse {
pub ticket: String, pub ticket: String,
pub port: u32, pub port: u32,
pub cert: String, pub cert: String,
} }
#[serde(rename_all = "camelCase")]
#[derive(Clone, Serialize, Deserialize)] #[derive(Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct TermProxyResponse { pub struct TermProxyResponse {
pub ticket: String, pub ticket: String,
pub port: u32, pub port: u32,
@@ -619,8 +619,8 @@ async fn delete_backup(
manager.delete_backup(&connection_id, &volid).await manager.delete_backup(&connection_id, &volid).await
} }
#[serde(rename_all = "camelCase")]
#[derive(Clone, Serialize, Deserialize)] #[derive(Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct TrayConnectionInfo { pub struct TrayConnectionInfo {
pub id: String, pub id: String,
pub name: String, pub name: String,
+20 -20
View File
@@ -1,7 +1,7 @@
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
#[serde(rename_all = "camelCase")]
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Disk { pub struct Disk {
pub device: String, pub device: String,
pub size: u64, pub size: u64,
@@ -10,16 +10,16 @@ pub struct Disk {
pub usage: Option<String>, pub usage: Option<String>,
} }
#[serde(rename_all = "camelCase")]
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct AddDiskConfig { pub struct AddDiskConfig {
pub storage: String, pub storage: String,
pub size: u64, pub size: u64,
pub bus_type: String, pub bus_type: String,
} }
#[serde(rename_all = "camelCase")]
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Node { pub struct Node {
pub node: String, pub node: String,
pub status: String, pub status: String,
@@ -35,8 +35,8 @@ pub struct Node {
pub r#type: String, pub r#type: String,
} }
#[serde(rename_all = "camelCase")]
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct VM { pub struct VM {
pub vmid: u32, pub vmid: u32,
pub name: Option<String>, pub name: Option<String>,
@@ -60,8 +60,8 @@ pub struct VM {
pub tags: Option<String>, pub tags: Option<String>,
} }
#[serde(rename_all = "camelCase")]
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Storage { pub struct Storage {
pub storage: String, pub storage: String,
pub r#type: String, pub r#type: String,
@@ -75,8 +75,8 @@ pub struct Storage {
pub node: String, pub node: String,
} }
#[serde(rename_all = "camelCase")]
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Task { pub struct Task {
pub upid: String, pub upid: String,
pub node: String, pub node: String,
@@ -91,8 +91,8 @@ pub struct Task {
pub exitstatus: Option<String>, pub exitstatus: Option<String>,
} }
#[serde(rename_all = "camelCase")]
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ClusterStatus { pub struct ClusterStatus {
pub r#type: String, pub r#type: String,
pub name: String, pub name: String,
@@ -100,8 +100,8 @@ pub struct ClusterStatus {
pub nodes: Option<Vec<ClusterNode>>, pub nodes: Option<Vec<ClusterNode>>,
} }
#[serde(rename_all = "camelCase")]
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ClusterNode { pub struct ClusterNode {
pub name: String, pub name: String,
pub nodeid: u32, pub nodeid: u32,
@@ -110,8 +110,8 @@ pub struct ClusterNode {
pub ip: Option<String>, pub ip: Option<String>,
} }
#[serde(rename_all = "camelCase")]
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Snapshot { pub struct Snapshot {
pub name: String, pub name: String,
pub description: String, pub description: String,
@@ -120,22 +120,22 @@ pub struct Snapshot {
pub parent: Option<String>, pub parent: Option<String>,
} }
#[serde(rename_all = "camelCase")]
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct CreateSnapshotConfig { pub struct CreateSnapshotConfig {
pub name: String, pub name: String,
pub description: Option<String>, pub description: Option<String>,
pub vmstate: Option<bool>, pub vmstate: Option<bool>,
} }
#[serde(rename_all = "camelCase")]
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ApiResponse<T> { pub struct ApiResponse<T> {
pub data: T, pub data: T,
} }
#[serde(rename_all = "camelCase")]
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct NetworkInterface { pub struct NetworkInterface {
pub name: String, pub name: String,
pub model: String, pub model: String,
@@ -146,8 +146,8 @@ pub struct NetworkInterface {
pub link_down: Option<u32>, pub link_down: Option<u32>,
} }
#[serde(rename_all = "camelCase")]
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct AddNICConfig { pub struct AddNICConfig {
pub bridge: String, pub bridge: String,
pub model: String, pub model: String,
@@ -156,8 +156,8 @@ pub struct AddNICConfig {
pub firewall: Option<bool>, pub firewall: Option<bool>,
} }
#[serde(rename_all = "camelCase")]
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct EditNICConfig { pub struct EditNICConfig {
pub bridge: Option<String>, pub bridge: Option<String>,
pub model: Option<String>, pub model: Option<String>,
@@ -165,8 +165,8 @@ pub struct EditNICConfig {
pub firewall: Option<bool>, pub firewall: Option<bool>,
} }
#[serde(rename_all = "camelCase")]
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Backup { pub struct Backup {
pub volid: String, pub volid: String,
pub backupid: String, pub backupid: String,
@@ -181,8 +181,8 @@ pub struct Backup {
pub ctime: u64, pub ctime: u64,
} }
#[serde(rename_all = "camelCase")]
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct BackupJob { pub struct BackupJob {
pub id: String, pub id: String,
pub store: String, pub store: String,
@@ -196,8 +196,8 @@ pub struct BackupJob {
pub quiet: Option<u32>, pub quiet: Option<u32>,
} }
#[serde(rename_all = "camelCase")]
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct BackupJobConfig { pub struct BackupJobConfig {
pub id: Option<String>, pub id: Option<String>,
pub storage: String, pub storage: String,
@@ -210,8 +210,8 @@ pub struct BackupJobConfig {
pub node: Option<String>, pub node: Option<String>,
} }
#[serde(rename_all = "camelCase")]
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct RestoreConfig { pub struct RestoreConfig {
pub volid: String, pub volid: String,
pub node: String, pub node: String,
@@ -219,8 +219,8 @@ pub struct RestoreConfig {
pub vmid: Option<u32>, pub vmid: Option<u32>,
} }
#[serde(rename_all = "camelCase")]
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct StorageContent { pub struct StorageContent {
pub content: String, pub content: String,
pub ctime: u64, pub ctime: u64,
@@ -230,8 +230,8 @@ pub struct StorageContent {
pub volid: String, pub volid: String,
} }
#[serde(rename_all = "camelCase")]
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct StorageDetail { pub struct StorageDetail {
pub storage: String, pub storage: String,
pub r#type: String, pub r#type: String,