summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/game_of_life/src/preset.rs9
1 files changed, 2 insertions, 7 deletions
diff --git a/examples/game_of_life/src/preset.rs b/examples/game_of_life/src/preset.rs
index 964b9120..552527b1 100644
--- a/examples/game_of_life/src/preset.rs
+++ b/examples/game_of_life/src/preset.rs
@@ -1,6 +1,7 @@
-#[derive(Debug, Clone, Copy, PartialEq, Eq)]
+#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)]
pub enum Preset {
Custom,
+ #[default]
Xkcd,
Glider,
SmallExploder,
@@ -114,12 +115,6 @@ impl Preset {
}
}
-impl Default for Preset {
- fn default() -> Preset {
- Preset::Xkcd
- }
-}
-
impl std::fmt::Display for Preset {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(