Use derive for default impl of DynamicVariant (#7986)
This commit is contained in:
parent
d3df04cb4c
commit
2908bb5e8a
@ -8,8 +8,9 @@ use std::any::Any;
|
||||
use std::fmt::Formatter;
|
||||
|
||||
/// A dynamic representation of an enum variant.
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Default)]
|
||||
pub enum DynamicVariant {
|
||||
#[default]
|
||||
Unit,
|
||||
Tuple(DynamicTuple),
|
||||
Struct(DynamicStruct),
|
||||
@ -25,12 +26,6 @@ impl Clone for DynamicVariant {
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for DynamicVariant {
|
||||
fn default() -> Self {
|
||||
DynamicVariant::Unit
|
||||
}
|
||||
}
|
||||
|
||||
impl From<DynamicTuple> for DynamicVariant {
|
||||
fn from(dyn_tuple: DynamicTuple) -> Self {
|
||||
Self::Tuple(dyn_tuple)
|
||||
|
Loading…
Reference in New Issue
Block a user