From 71b9b3c3b1242dd571170fb0f8dd22760a1b4c53 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Tue, 12 Mar 2024 13:41:14 +0100 Subject: Use closures for `Svg::style` --- examples/svg/src/main.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'examples/svg/src/main.rs') diff --git a/examples/svg/src/main.rs b/examples/svg/src/main.rs index 4e238048..0870dce4 100644 --- a/examples/svg/src/main.rs +++ b/examples/svg/src/main.rs @@ -41,12 +41,12 @@ impl Sandbox for Tiger { )); let svg = svg(handle).width(Length::Fill).height(Length::Fill).style( - if self.apply_color_filter { - |_theme, _status| svg::Appearance { - color: Some(color!(0x0000ff)), - } - } else { - |_theme, _status| svg::Appearance::default() + |_theme, _status| svg::Appearance { + color: if self.apply_color_filter { + Some(color!(0x0000ff)) + } else { + None + }, }, ); -- cgit