Derive Default for Value (clippy)

This commit is contained in:
Alex Orlenko
2025-09-28 23:41:46 +01:00
parent 5b38af9746
commit e08768cc5e
+2 -7
View File
@@ -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() {