From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 1156F1FF14F for ; Fri, 08 May 2026 17:06:17 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id E788E1C932; Fri, 8 May 2026 17:06:16 +0200 (CEST) From: Shannon Sterz To: yew-devel@lists.proxmox.com Subject: [PATCH yew-mobile-gui 06/20] tree-wide: implement `Default` for types with an `new()` constructor Date: Fri, 8 May 2026 17:05:21 +0200 Message-ID: <20260508150535.420205-7-s.sterz@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260508150535.420205-1-s.sterz@proxmox.com> References: <20260508150535.420205-1-s.sterz@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1778252629724 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.117 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: FHXZO7FJKRVWUW2MPKAMEVFTSMOX63C3 X-Message-ID-Hash: FHXZO7FJKRVWUW2MPKAMEVFTSMOX63C3 X-MailFrom: s.sterz@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Yew framework devel list at Proxmox List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: ... that does not take any parameters. fixes the clippy lint "clippy::new_without_default" [1]. [1]: https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default Signed-off-by: Shannon Sterz --- src/pages/page_cluster_firewall/mod.rs | 6 ++++++ src/pages/page_configuartion.rs | 6 ++++++ src/pages/page_dashboard.rs | 6 ++++++ src/pages/page_login.rs | 6 ++++++ src/pages/page_resources.rs | 6 ++++++ src/pages/page_settings.rs | 6 ++++++ src/widgets/task_list_button.rs | 6 ++++++ src/widgets/top_nav_bar.rs | 6 ++++++ 8 files changed, 48 insertions(+) diff --git a/src/pages/page_cluster_firewall/mod.rs b/src/pages/page_cluster_firewall/mod.rs index d422417..6bb8253 100644 --- a/src/pages/page_cluster_firewall/mod.rs +++ b/src/pages/page_cluster_firewall/mod.rs @@ -16,6 +16,12 @@ use crate::widgets::TopNavBar; #[derive(Clone, PartialEq, Properties)] pub struct PageClusterFirewall {} +impl Default for PageClusterFirewall { + fn default() -> Self { + Self::new() + } +} + impl PageClusterFirewall { pub fn new() -> Self { Self {} diff --git a/src/pages/page_configuartion.rs b/src/pages/page_configuartion.rs index debcbd7..36e3a69 100644 --- a/src/pages/page_configuartion.rs +++ b/src/pages/page_configuartion.rs @@ -14,6 +14,12 @@ use proxmox_yew_comp::layout::list_tile::icon_list_tile; use crate::Route; use crate::widgets::TopNavBar; +impl Default for PageConfiguration { + fn default() -> Self { + Self::new() + } +} + impl PageConfiguration { pub fn new() -> Self { Self {} diff --git a/src/pages/page_dashboard.rs b/src/pages/page_dashboard.rs index 18640d4..ff890ca 100644 --- a/src/pages/page_dashboard.rs +++ b/src/pages/page_dashboard.rs @@ -26,6 +26,12 @@ use crate::widgets::TopNavBar; #[derive(Clone, PartialEq, Properties)] pub struct PageDashboard {} +impl Default for PageDashboard { + fn default() -> Self { + Self::new() + } +} + impl PageDashboard { pub fn new() -> Self { Self {} diff --git a/src/pages/page_login.rs b/src/pages/page_login.rs index 98773bf..8b7fa42 100644 --- a/src/pages/page_login.rs +++ b/src/pages/page_login.rs @@ -29,6 +29,12 @@ pub struct PageLogin { pub consent_text: Option, } +impl Default for PageLogin { + fn default() -> Self { + Self::new() + } +} + impl PageLogin { pub fn new() -> Self { yew::props!(Self {}) diff --git a/src/pages/page_resources.rs b/src/pages/page_resources.rs index 20bd124..1365d63 100644 --- a/src/pages/page_resources.rs +++ b/src/pages/page_resources.rs @@ -26,6 +26,12 @@ use pve_api_types::{ClusterResource, ClusterResourceType}; #[derive(Clone, PartialEq, Properties)] pub struct PageResources {} +impl Default for PageResources { + fn default() -> Self { + Self::new() + } +} + impl PageResources { pub fn new() -> Self { Self {} diff --git a/src/pages/page_settings.rs b/src/pages/page_settings.rs index 881c219..28ef32d 100644 --- a/src/pages/page_settings.rs +++ b/src/pages/page_settings.rs @@ -14,6 +14,12 @@ use proxmox_yew_comp::layout::mobile_form::label_widget; #[derive(Clone, PartialEq, Properties)] pub struct PageSettings {} +impl Default for PageSettings { + fn default() -> Self { + Self::new() + } +} + impl PageSettings { pub fn new() -> Self { Self {} diff --git a/src/widgets/task_list_button.rs b/src/widgets/task_list_button.rs index 7321b1d..bd42199 100644 --- a/src/widgets/task_list_button.rs +++ b/src/widgets/task_list_button.rs @@ -36,6 +36,12 @@ pub struct TasksListButton { pub on_show_task_list: Option>, } +impl Default for TasksListButton { + fn default() -> Self { + Self::new() + } +} + impl TasksListButton { pub fn new() -> Self { yew::props!(Self {}) diff --git a/src/widgets/top_nav_bar.rs b/src/widgets/top_nav_bar.rs index 128ce3e..7adf2ee 100644 --- a/src/widgets/top_nav_bar.rs +++ b/src/widgets/top_nav_bar.rs @@ -36,6 +36,12 @@ pub struct TopNavBar { menu_items: Vec, } +impl Default for TopNavBar { + fn default() -> Self { + Self::new() + } +} + impl TopNavBar { pub fn new() -> Self { yew::props!(Self {}) -- 2.47.3