add defaults for the several structs
This commit is contained in:
committed by
Sébastien Crozet
parent
1608a1323e
commit
536122e080
@@ -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
|
||||
|
||||
@@ -125,7 +125,7 @@ impl<E> Edge<E> {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(Clone, Debug,Default)]
|
||||
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
|
||||
pub struct Graph<N, E> {
|
||||
pub(crate) nodes: Vec<Node<N>>,
|
||||
|
||||
Reference in New Issue
Block a user