summaryrefslogtreecommitdiffstats
path: root/examples/game_of_life/src
diff options
context:
space:
mode:
authorLibravatar Bingus <shankern@protonmail.com>2023-02-15 14:55:02 -0800
committerLibravatar Bingus <shankern@protonmail.com>2023-02-15 14:55:02 -0800
commit63fb608d8bea8a653bf011f5f9cffc88525576e0 (patch)
tree938c15b85fd9d27ee3a82806cf83bc211e7b94dd /examples/game_of_life/src
parent64e0e817c27d720dc954ee94de58ded35b3f9f9a (diff)
parent0cb72f69716adc82ad85a0ee7120edb6e653b0c0 (diff)
downloadiced-63fb608d8bea8a653bf011f5f9cffc88525576e0.tar.gz
iced-63fb608d8bea8a653bf011f5f9cffc88525576e0.tar.bz2
iced-63fb608d8bea8a653bf011f5f9cffc88525576e0.zip
Merge remote-tracking branch 'origin/master' into feat/multi-window-support
# Conflicts: # native/src/command/action.rs # native/src/window/action.rs # winit/src/window.rs
Diffstat (limited to 'examples/game_of_life/src')
-rw-r--r--examples/game_of_life/src/main.rs2
-rw-r--r--examples/game_of_life/src/preset.rs9
2 files changed, 3 insertions, 8 deletions
diff --git a/examples/game_of_life/src/main.rs b/examples/game_of_life/src/main.rs
index b0f1c96d..ed911160 100644
--- a/examples/game_of_life/src/main.rs
+++ b/examples/game_of_life/src/main.rs
@@ -176,7 +176,7 @@ fn view_controls<'a>(
let speed_controls = row![
slider(1.0..=1000.0, speed as f32, Message::SpeedChanged),
- text(format!("x{}", speed)).size(16),
+ text(format!("x{speed}")).size(16),
]
.width(Length::Fill)
.align_items(Alignment::Center)
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!(