Skip to content

Commit e08768c

Browse files
committed
Derive Default for Value (clippy)
1 parent 5b38af9 commit e08768c

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/value.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ use {
2828
/// The non-primitive variants (eg. string/table/function/thread/userdata) contain handle types
2929
/// into the internal Lua state. It is a logic error to mix handle types between separate
3030
/// `Lua` instances, and doing so will result in a panic.
31-
#[derive(Clone)]
31+
#[derive(Clone, Default)]
3232
pub enum Value {
3333
/// The Lua value `nil`.
34+
#[default]
3435
Nil,
3536
/// The Lua value `true` or `false`.
3637
Boolean(bool),
@@ -579,12 +580,6 @@ impl Value {
579580
}
580581
}
581582

582-
impl Default for Value {
583-
fn default() -> Self {
584-
Self::Nil
585-
}
586-
}
587-
588583
impl fmt::Debug for Value {
589584
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
590585
if fmt.alternate() {

0 commit comments

Comments
 (0)