We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Default
Value
1 parent 5b38af9 commit e08768cCopy full SHA for e08768c
src/value.rs
@@ -28,9 +28,10 @@ use {
28
/// The non-primitive variants (eg. string/table/function/thread/userdata) contain handle types
29
/// into the internal Lua state. It is a logic error to mix handle types between separate
30
/// `Lua` instances, and doing so will result in a panic.
31
-#[derive(Clone)]
+#[derive(Clone, Default)]
32
pub enum Value {
33
/// The Lua value `nil`.
34
+ #[default]
35
Nil,
36
/// The Lua value `true` or `false`.
37
Boolean(bool),
@@ -579,12 +580,6 @@ impl Value {
579
580
}
581
582
-impl Default for Value {
583
- fn default() -> Self {
584
- Self::Nil
585
- }
586
-}
587
-
588
impl fmt::Debug for Value {
589
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
590
if fmt.alternate() {
0 commit comments