chiark
/
gitweb
/
~ianmdlvl
/
otter.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
46e2e0d
)
InstanceBundles: impl Default and use that for new()
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Thu, 31 Mar 2022 00:13:22 +0000
(
01:13
+0100)
committer
Ian 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
patch
|
blob
|
history
diff --git
a/src/bundles.rs
b/src/bundles.rs
index 6c96609d378d02e295e96afefc34c77702640975..390b4a4186a52bed566f5bd8820e99356e7fc279 100644
(file)
--- 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<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)| {