From 2d461812402cc0e05bd52fde8ac689497f3df14f Mon Sep 17 00:00:00 2001 From: Luni-4 Date: Wed, 12 Jul 2023 15:45:14 +0200 Subject: [PATCH 1/4] examples: Update iced version for cupertino --- examples/cupertino/cupertino_alert/Cargo.toml | 2 +- examples/cupertino/cupertino_button/Cargo.toml | 2 +- examples/cupertino/cupertino_switch/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/cupertino/cupertino_alert/Cargo.toml b/examples/cupertino/cupertino_alert/Cargo.toml index ef99d2ec..6b386ea6 100644 --- a/examples/cupertino/cupertino_alert/Cargo.toml +++ b/examples/cupertino/cupertino_alert/Cargo.toml @@ -6,6 +6,6 @@ edition = "2021" publish = false [dependencies] -iced = { version = "0.8.0", features = [] } +iced = { version = "0.9.0", features = [] } iced_aw = { path = "../../../", features = ["cupertino"] } diff --git a/examples/cupertino/cupertino_button/Cargo.toml b/examples/cupertino/cupertino_button/Cargo.toml index 07ea0d4a..d65f8888 100644 --- a/examples/cupertino/cupertino_button/Cargo.toml +++ b/examples/cupertino/cupertino_button/Cargo.toml @@ -6,6 +6,6 @@ edition = "2021" publish = false [dependencies] -iced = { version = "0.8.0", features = [] } +iced = { version = "0.9.0", features = [] } iced_aw = { path = "../../../", features = ["cupertino"] } diff --git a/examples/cupertino/cupertino_switch/Cargo.toml b/examples/cupertino/cupertino_switch/Cargo.toml index 3eb0a94f..6f6b80b0 100644 --- a/examples/cupertino/cupertino_switch/Cargo.toml +++ b/examples/cupertino/cupertino_switch/Cargo.toml @@ -6,6 +6,6 @@ edition = "2021" publish = false [dependencies] -iced = { version = "0.8.0", features = [] } +iced = { version = "0.9.0", features = [] } iced_aw = { path = "../../../", features = ["cupertino"] } From 1270bcf750fc77c2a7599985593ef2f16be7d386 Mon Sep 17 00:00:00 2001 From: Luni-4 Date: Wed, 12 Jul 2023 15:51:37 +0200 Subject: [PATCH 2/4] examples: Change rustfmt attribute --- examples/cupertino/cupertino_alert/src/main.rs | 4 ++-- examples/cupertino/cupertino_button/src/main.rs | 2 +- examples/cupertino/cupertino_switch/src/main.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/cupertino/cupertino_alert/src/main.rs b/examples/cupertino/cupertino_alert/src/main.rs index f18848c2..5b499681 100644 --- a/examples/cupertino/cupertino_alert/src/main.rs +++ b/examples/cupertino/cupertino_alert/src/main.rs @@ -30,7 +30,7 @@ enum Message { ShowModal, } -#[cfg_attr(rustfmt, rustfmt_skip)] +#[rustfmt::skip] mod constants { pub static PRIMARY_TEXT: &'static str = "Allow \"Maps\" to access your location while using the app?"; pub static SECONDARY_TEXT: &'static str = "Your current location will be displayed on the map and used for directions, nearby search results, and estimated travel times. "; @@ -41,7 +41,7 @@ mod constants { use constants::*; // `cargo fmt` becomes unreadable for this example, so switching off // -#[cfg_attr(rustfmt, rustfmt_skip)] +#[rustfmt::skip] impl Application for Alert { type Executor = executor::Default; type Message = Message; diff --git a/examples/cupertino/cupertino_button/src/main.rs b/examples/cupertino/cupertino_button/src/main.rs index bd7d233b..129ae913 100644 --- a/examples/cupertino/cupertino_button/src/main.rs +++ b/examples/cupertino/cupertino_button/src/main.rs @@ -26,7 +26,7 @@ enum Message { } // `cargo fmt` becomes unreadable for this example, so switching off // -#[cfg_attr(rustfmt, rustfmt_skip)] +#[rustfmt::skip] impl Application for ButtonApp { type Executor = executor::Default; type Message = Message; diff --git a/examples/cupertino/cupertino_switch/src/main.rs b/examples/cupertino/cupertino_switch/src/main.rs index 3e381635..b5afa204 100644 --- a/examples/cupertino/cupertino_switch/src/main.rs +++ b/examples/cupertino/cupertino_switch/src/main.rs @@ -22,7 +22,7 @@ enum Message { } // `cargo fmt` becomes unreadable for this example, so switching off // -#[cfg_attr(rustfmt, rustfmt_skip)] +#[rustfmt::skip] impl Application for Switch { type Executor = executor::Default; type Message = Message; From 811b2483cbdba3da64813dad577d55f09bb8008d Mon Sep 17 00:00:00 2001 From: Luni-4 Date: Wed, 12 Jul 2023 15:52:40 +0200 Subject: [PATCH 3/4] examples: Remove useless lifetimes --- examples/cupertino/cupertino_alert/src/main.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/cupertino/cupertino_alert/src/main.rs b/examples/cupertino/cupertino_alert/src/main.rs index 5b499681..ad5b5a93 100644 --- a/examples/cupertino/cupertino_alert/src/main.rs +++ b/examples/cupertino/cupertino_alert/src/main.rs @@ -32,10 +32,10 @@ enum Message { #[rustfmt::skip] mod constants { - pub static PRIMARY_TEXT: &'static str = "Allow \"Maps\" to access your location while using the app?"; - pub static SECONDARY_TEXT: &'static str = "Your current location will be displayed on the map and used for directions, nearby search results, and estimated travel times. "; - pub static ALLOW: &'static str = "Allow"; - pub static DONT_ALLOW: &'static str = "Don't Allow"; + pub static PRIMARY_TEXT: &str = "Allow \"Maps\" to access your location while using the app?"; + pub static SECONDARY_TEXT: &str = "Your current location will be displayed on the map and used for directions, nearby search results, and estimated travel times. "; + pub static ALLOW: &str = "Allow"; + pub static DONT_ALLOW: &str = "Don't Allow"; } use constants::*; From fac20b166417362aaa624e2a906f588caec05fe6 Mon Sep 17 00:00:00 2001 From: Luni-4 Date: Wed, 12 Jul 2023 15:53:43 +0200 Subject: [PATCH 4/4] examples: Simplify match --- examples/cupertino/cupertino_alert/src/main.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/examples/cupertino/cupertino_alert/src/main.rs b/examples/cupertino/cupertino_alert/src/main.rs index ad5b5a93..4d231e29 100644 --- a/examples/cupertino/cupertino_alert/src/main.rs +++ b/examples/cupertino/cupertino_alert/src/main.rs @@ -69,10 +69,7 @@ impl Application for Alert { } fn view(&self) -> Element { - let modal_hidden: bool = match self { - Alert::ShowModal => false, - _ => true, - }; + let modal_hidden = !matches!(self, Alert::ShowModal); match self { Alert::CancelEvent => println!("Received click for the cancel button"),