more clippy fixes and annotations

the remaining ones are:
- type complexity
- fns with many arguments
- new() without default()
- false positives for redundant closures (where closure returns a static
  value)
- expected vs actual length check without match/cmp

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2022-07-26 13:36:14 +02:00
parent 1647fc93ff
commit 74092debc5

View File

@ -1190,7 +1190,7 @@ pub struct TypeCounts {
}, },
}, },
)] )]
#[derive(Clone, Serialize, Deserialize)] #[derive(Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")] #[serde(rename_all = "kebab-case")]
/// Garbage collection status. /// Garbage collection status.
pub struct GarbageCollectionStatus { pub struct GarbageCollectionStatus {
@ -1217,24 +1217,6 @@ pub struct GarbageCollectionStatus {
pub still_bad: usize, pub still_bad: usize,
} }
impl Default for GarbageCollectionStatus {
fn default() -> Self {
GarbageCollectionStatus {
upid: None,
index_file_count: 0,
index_data_bytes: 0,
disk_bytes: 0,
disk_chunks: 0,
removed_bytes: 0,
removed_chunks: 0,
pending_bytes: 0,
pending_chunks: 0,
removed_bad: 0,
still_bad: 0,
}
}
}
#[api( #[api(
properties: { properties: {
"gc-status": { "gc-status": {