From e08768cc5e2154245fa16a3ae31431ee4dc0981e Mon Sep 17 00:00:00 2001 From: Alex Orlenko Date: Sun, 28 Sep 2025 23:41:46 +0100 Subject: [PATCH] Derive `Default` for `Value` (clippy) --- src/value.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) 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() {