summaryrefslogtreecommitdiff
path: root/ecs/src/lock.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ecs/src/lock.rs')
-rw-r--r--ecs/src/lock.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/ecs/src/lock.rs b/ecs/src/lock.rs
index 689070b..fe4e08b 100644
--- a/ecs/src/lock.rs
+++ b/ecs/src/lock.rs
@@ -1,3 +1,4 @@
+use std::any::type_name;
use std::mem::forget;
use std::ops::{Deref, DerefMut};
@@ -62,6 +63,14 @@ impl<Value> Lock<Value>
}
}
+impl<Value: Default + 'static> Default for Lock<Value>
+{
+ fn default() -> Self
+ {
+ Self::new(Value::default(), type_name::<Value>())
+ }
+}
+
#[derive(Debug, thiserror::Error)]
pub enum Error
{