chiark / gitweb /
InstanceBundles: impl Default and use that for new()
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 31 Mar 2022 00:13:22 +0000 (01:13 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 31 Mar 2022 00:13:22 +0000 (01:13 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/bundles.rs

index 6c96609d378d02e295e96afefc34c77702640975..390b4a4186a52bed566f5bd8820e99356e7fc279 100644 (file)
@@ -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<Option<Note>>,
 }
@@ -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<Item=(Id, &State)> {
     self.bundles.iter().enumerate().filter_map(|(index, slot)| {