aboutsummaryrefslogtreecommitdiff
path: root/src/data
diff options
context:
space:
mode:
Diffstat (limited to 'src/data')
-rw-r--r--src/data/arena.rs8
-rw-r--r--src/data/graph.rs2
2 files changed, 8 insertions, 2 deletions
diff --git a/src/data/arena.rs b/src/data/arena.rs
index b14737e..00e3124 100644
--- a/src/data/arena.rs
+++ b/src/data/arena.rs
@@ -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
diff --git a/src/data/graph.rs b/src/data/graph.rs
index 2dc7fbf..dd2c760 100644
--- a/src/data/graph.rs
+++ b/src/data/graph.rs
@@ -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>>,