From 74092debc5d51af3891c87e30915aa39fd7b23ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Tue, 26 Jul 2022 13:36:14 +0200 Subject: [PATCH] more clippy fixes and annotations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- pbs-api-types/src/datastore.rs | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/pbs-api-types/src/datastore.rs b/pbs-api-types/src/datastore.rs index 170d248f..fbd01fc4 100644 --- a/pbs-api-types/src/datastore.rs +++ b/pbs-api-types/src/datastore.rs @@ -1190,7 +1190,7 @@ pub struct TypeCounts { }, }, )] -#[derive(Clone, Serialize, Deserialize)] +#[derive(Clone, Default, Serialize, Deserialize)] #[serde(rename_all = "kebab-case")] /// Garbage collection status. pub struct GarbageCollectionStatus { @@ -1217,24 +1217,6 @@ pub struct GarbageCollectionStatus { 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( properties: { "gc-status": {