Clearing bundles is going to want to check this.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
pub fn as_mut(&mut self, _: ModifyingPieces) -> &mut ActualIPieces {
&mut self.0
}
+
+ pub fn is_empty(&self) -> bool {
+ let IPieces(actual) = self;
+ actual.is_empty()
+ }
}
// ---------- gamestate pieces table ----------
}
})
}
+
+ pub fn is_empty(&self) -> bool {
+ let GameOccults { occults } = self;
+ occults.is_empty()
+ }
}
// ========== public entrypoints ==========
self.lookup.remove(&data.k);
}
}
+
+ pub fn is_empty(&self) -> bool {
+ let OccultIlks { lookup, table } = self;
+ #[allow(unused_parens)]
+ (
+ lookup.is_empty()
+ && table.is_empty()
+ )
+ }
}
impl Borrow<Id> for OId {
fn borrow(&self) -> &Id { &self.0 }
}
+
+impl IOccults {
+ pub fn is_empty(&self) -> bool {
+ let IOccults { ilks } = self;
+ ilks.is_empty()
+ }
+}
pub fn keys(&self) -> impl Iterator<Item=&String> {
self.map.keys()
}
+
+ pub fn is_empty(&self) -> bool {
+ let PieceAliases { map } = self;
+ map.is_empty()
+ }
}
#[derive(Debug,Clone,Serialize,Deserialize)]