diff --git a/src/value.rs b/src/value.rs index 8fbfa32..ff3ed3a 100644 --- a/src/value.rs +++ b/src/value.rs @@ -28,9 +28,10 @@ use { /// The non-primitive variants (eg. string/table/function/thread/userdata) contain handle types /// into the internal Lua state. It is a logic error to mix handle types between separate /// `Lua` instances, and doing so will result in a panic. -#[derive(Clone)] +#[derive(Clone, Default)] pub enum Value { /// The Lua value `nil`. + #[default] Nil, /// The Lua value `true` or `false`. Boolean(bool), @@ -579,12 +580,6 @@ impl Value { } } -impl Default for Value { - fn default() -> Self { - Self::Nil - } -} - impl fmt::Debug for Value { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { if fmt.alternate() {