mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 15:14:50 +00:00
Use derive for default impl of DynamicVariant (#7986)
This commit is contained in:
parent
d3df04cb4c
commit
2908bb5e8a
1 changed files with 2 additions and 7 deletions
|
@ -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 a new issue