Skip to content

Commit

Permalink
Use derive for default impl of DynamicVariant (#7986)
Browse files Browse the repository at this point in the history
  • Loading branch information
rparrett authored Mar 8, 2023
1 parent d3df04c commit 2908bb5
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions crates/bevy_reflect/src/enums/dynamic_enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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)
Expand Down

0 comments on commit 2908bb5

Please sign in to comment.