From 0ac7f83bd6f3f96a10fbaadec25dbc54777498d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Thu, 3 Nov 2022 03:22:55 +0100 Subject: [PATCH] Derive `Copy` for `Theme` --- examples/arc/src/main.rs | 2 +- examples/styling/src/main.rs | 2 +- style/src/theme.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/arc/src/main.rs b/examples/arc/src/main.rs index 69712240f5..0c619dc9ba 100644 --- a/examples/arc/src/main.rs +++ b/examples/arc/src/main.rs @@ -80,7 +80,7 @@ impl canvas::Program for Arc { _cursor: Cursor, ) -> Vec { let geometry = self.cache.draw(bounds.size(), |frame| { - let palette = theme.clone().palette(); + let palette = theme.palette(); let center = frame.center(); let radius = frame.width().min(frame.height()) / 5.0; diff --git a/examples/styling/src/main.rs b/examples/styling/src/main.rs index e16860adc9..6bcfa5f179 100644 --- a/examples/styling/src/main.rs +++ b/examples/styling/src/main.rs @@ -159,6 +159,6 @@ impl Sandbox for Styling { } fn theme(&self) -> Theme { - self.theme.clone() + self.theme } } diff --git a/style/src/theme.rs b/style/src/theme.rs index 38dba30f02..8c16391629 100644 --- a/style/src/theme.rs +++ b/style/src/theme.rs @@ -21,7 +21,7 @@ use crate::toggler; use iced_core::{Background, Color}; -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq)] pub enum Theme { Light, Dark, @@ -56,7 +56,7 @@ impl Default for Theme { } } -#[derive(Debug, Clone, PartialEq)] +#[derive(Debug, Clone, Copy, PartialEq)] pub struct Custom { palette: Palette, extended: Extended,