From 82ab2c4c57b6ad6b3acc54a38229ab11e2542161 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 31 Mar 2022 01:13:22 +0100 Subject: [PATCH] InstanceBundles: impl Default and use that for new() Signed-off-by: Ian Jackson --- src/bundles.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/bundles.rs b/src/bundles.rs index 6c96609d..390b4a41 100644 --- a/src/bundles.rs +++ b/src/bundles.rs @@ -29,7 +29,7 @@ pub struct Index(u16); #[derive(Serialize,Deserialize)] pub struct Id { pub index: Index, pub kind: Kind, } -#[derive(Debug,Clone)] +#[derive(Debug,Clone,Default)] pub struct InstanceBundles { bundles: Vec>, } @@ -1026,11 +1026,7 @@ fn incorporate_bundle(ib: &mut InstanceBundles, ig: &mut Instance, } impl InstanceBundles { - pub fn new() -> Self { - InstanceBundles{ - bundles: default(), - } - } + pub fn new() -> Self { default() } fn iter(&self) -> impl Iterator { self.bundles.iter().enumerate().filter_map(|(index, slot)| { -- 2.30.2