From: Ian Jackson Date: Thu, 31 Mar 2022 00:13:22 +0000 (+0100) Subject: InstanceBundles: impl Default and use that for new() X-Git-Tag: otter-1.0.0~53 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=82ab2c4c57b6ad6b3acc54a38229ab11e2542161;p=otter.git InstanceBundles: impl Default and use that for new() Signed-off-by: Ian Jackson --- 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)| {