add defaults for the several structs

This commit is contained in:
zhguchev
2022-01-11 14:56:26 +01:00
committed by Sébastien Crozet
parent 1608a1323e
commit 536122e080
12 changed files with 46 additions and 10 deletions

View File

@@ -52,10 +52,16 @@ pub struct Index {
generation: u32,
}
impl IndexedData for Index {
impl Default for Index {
fn default() -> Self {
Self::from_raw_parts(crate::INVALID_U32, crate::INVALID_U32)
}
}
impl IndexedData for Index {
fn default() -> Self {
Default::default()
}
fn index(&self) -> usize {
self.into_raw_parts().0 as usize