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 64C331FF14F for ; Fri, 08 May 2026 17:58:08 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 44E7D1D8AD; Fri, 8 May 2026 17:58:08 +0200 (CEST) From: Shannon Sterz To: yew-devel@lists.proxmox.com Subject: [PATCH yew-mobile-gui v2 05/21] tree-wide: implement the `From` trait instead of the `Into` trait Date: Fri, 8 May 2026 17:57:06 +0200 Message-ID: <20260508155722.464564-6-s.sterz@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260508155722.464564-1-s.sterz@proxmox.com> References: <20260508155722.464564-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: 1778255735654 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.115 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: ERZEX7MRFIMFYOXYOMZD7WZ3RXHIGTHW X-Message-ID-Hash: ERZEX7MRFIMFYOXYOMZD7WZ3RXHIGTHW 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: this is usually more flexible, as a `From` implementation yields an `Into` implementation for free. fixes the clippy lint "clippy::from_over_into" [1]. [1]: https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into 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_lxc_status/dashboard_panel.rs | 6 +++--- src/pages/page_lxc_status/mod.rs | 6 +++--- src/pages/page_lxc_tasks.rs | 6 +++--- src/pages/page_node_status/dashboard_panel.rs | 6 +++--- src/pages/page_node_status/mod.rs | 6 +++--- src/pages/page_node_tasks.rs | 6 +++--- src/pages/page_qemu_status/dashboard_panel.rs | 6 +++--- src/pages/page_qemu_status/firewall_panel.rs | 6 +++--- src/pages/page_qemu_status/mod.rs | 6 +++--- src/pages/page_qemu_tasks.rs | 6 +++--- src/pages/page_resources.rs | 6 +++--- src/pages/page_settings.rs | 6 +++--- src/pages/page_storage_status.rs | 6 +++--- src/pages/page_task_status.rs | 6 +++--- src/widgets/top_nav_bar.rs | 6 +++--- 19 files changed, 57 insertions(+), 57 deletions(-) diff --git a/src/pages/page_cluster_firewall/mod.rs b/src/pages/page_cluster_firewall/mod.rs index 278de59..d422417 100644 --- a/src/pages/page_cluster_firewall/mod.rs +++ b/src/pages/page_cluster_firewall/mod.rs @@ -158,9 +158,9 @@ impl Component for PvePageClusterFirewall { } } -impl Into for PageClusterFirewall { - fn into(self) -> VNode { - let comp = VComp::new::(Rc::new(self), None); +impl From for VNode { + fn from(val: PageClusterFirewall) -> Self { + let comp = VComp::new::(Rc::new(val), None); VNode::from(comp) } } diff --git a/src/pages/page_configuartion.rs b/src/pages/page_configuartion.rs index 7a60825..debcbd7 100644 --- a/src/pages/page_configuartion.rs +++ b/src/pages/page_configuartion.rs @@ -97,9 +97,9 @@ impl Component for PvePageConfiguration { } } -impl Into for PageConfiguration { - fn into(self) -> VNode { - let comp = VComp::new::(Rc::new(self), None); +impl From for VNode { + fn from(val: PageConfiguration) -> Self { + let comp = VComp::new::(Rc::new(val), None); VNode::from(comp) } } diff --git a/src/pages/page_dashboard.rs b/src/pages/page_dashboard.rs index 211d66d..18640d4 100644 --- a/src/pages/page_dashboard.rs +++ b/src/pages/page_dashboard.rs @@ -492,9 +492,9 @@ impl Component for PvePageDashboard { } } -impl Into for PageDashboard { - fn into(self) -> VNode { - let comp = VComp::new::(Rc::new(self), None); +impl From for VNode { + fn from(val: PageDashboard) -> Self { + let comp = VComp::new::(Rc::new(val), None); VNode::from(comp) } } diff --git a/src/pages/page_login.rs b/src/pages/page_login.rs index 63fad30..98773bf 100644 --- a/src/pages/page_login.rs +++ b/src/pages/page_login.rs @@ -108,9 +108,9 @@ impl Component for PvePageLogin { } } -impl Into for PageLogin { - fn into(self) -> VNode { - let comp = VComp::new::(Rc::new(self), None); +impl From for VNode { + fn from(val: PageLogin) -> Self { + let comp = VComp::new::(Rc::new(val), None); VNode::from(comp) } } diff --git a/src/pages/page_lxc_status/dashboard_panel.rs b/src/pages/page_lxc_status/dashboard_panel.rs index 8009dcc..e597116 100644 --- a/src/pages/page_lxc_status/dashboard_panel.rs +++ b/src/pages/page_lxc_status/dashboard_panel.rs @@ -363,9 +363,9 @@ impl Component for PveLxcDashboardPanel { } } -impl Into for LxcDashboardPanel { - fn into(self) -> VNode { - let comp = VComp::new::(Rc::new(self), None); +impl From for VNode { + fn from(val: LxcDashboardPanel) -> Self { + let comp = VComp::new::(Rc::new(val), None); VNode::from(comp) } } diff --git a/src/pages/page_lxc_status/mod.rs b/src/pages/page_lxc_status/mod.rs index 71bd707..97ebddf 100644 --- a/src/pages/page_lxc_status/mod.rs +++ b/src/pages/page_lxc_status/mod.rs @@ -134,9 +134,9 @@ impl Component for PvePageLxcStatus { } } -impl Into for PageLxcStatus { - fn into(self) -> VNode { - let comp = VComp::new::(Rc::new(self), None); +impl From for VNode { + fn from(val: PageLxcStatus) -> Self { + let comp = VComp::new::(Rc::new(val), None); VNode::from(comp) } } diff --git a/src/pages/page_lxc_tasks.rs b/src/pages/page_lxc_tasks.rs index 30d00c2..044d393 100644 --- a/src/pages/page_lxc_tasks.rs +++ b/src/pages/page_lxc_tasks.rs @@ -68,9 +68,9 @@ pub fn PvePageLxcTasks(props: &PageLxcTasks) -> Html { .into() } -impl Into for PageLxcTasks { - fn into(self) -> VNode { - let comp = VComp::new::(Rc::new(self), None); +impl From for VNode { + fn from(val: PageLxcTasks) -> Self { + let comp = VComp::new::(Rc::new(val), None); VNode::from(comp) } } diff --git a/src/pages/page_node_status/dashboard_panel.rs b/src/pages/page_node_status/dashboard_panel.rs index 1a723fe..848fb6f 100644 --- a/src/pages/page_node_status/dashboard_panel.rs +++ b/src/pages/page_node_status/dashboard_panel.rs @@ -232,9 +232,9 @@ impl Component for PveNodeDashboardPanel { } } -impl Into for NodeDashboardPanel { - fn into(self) -> VNode { - let comp = VComp::new::(Rc::new(self), None); +impl From for VNode { + fn from(val: NodeDashboardPanel) -> Self { + let comp = VComp::new::(Rc::new(val), None); VNode::from(comp) } } diff --git a/src/pages/page_node_status/mod.rs b/src/pages/page_node_status/mod.rs index 5766b61..be6a98c 100644 --- a/src/pages/page_node_status/mod.rs +++ b/src/pages/page_node_status/mod.rs @@ -164,9 +164,9 @@ impl Component for PvePageNodeStatus { } } -impl Into for PageNodeStatus { - fn into(self) -> VNode { - let comp = VComp::new::(Rc::new(self), None); +impl From for VNode { + fn from(val: PageNodeStatus) -> Self { + let comp = VComp::new::(Rc::new(val), None); VNode::from(comp) } } diff --git a/src/pages/page_node_tasks.rs b/src/pages/page_node_tasks.rs index 5ea3bea..2f4773b 100644 --- a/src/pages/page_node_tasks.rs +++ b/src/pages/page_node_tasks.rs @@ -59,9 +59,9 @@ pub fn PvePageNodeTasks(props: &PageNodeTasks) -> Html { .into() } -impl Into for PageNodeTasks { - fn into(self) -> VNode { - let comp = VComp::new::(Rc::new(self), None); +impl From for VNode { + fn from(val: PageNodeTasks) -> Self { + let comp = VComp::new::(Rc::new(val), None); VNode::from(comp) } } diff --git a/src/pages/page_qemu_status/dashboard_panel.rs b/src/pages/page_qemu_status/dashboard_panel.rs index 3120046..47aa89c 100644 --- a/src/pages/page_qemu_status/dashboard_panel.rs +++ b/src/pages/page_qemu_status/dashboard_panel.rs @@ -409,9 +409,9 @@ impl Component for PveQemuDashboardPanel { } } -impl Into for QemuDashboardPanel { - fn into(self) -> VNode { - let comp = VComp::new::(Rc::new(self), None); +impl From for VNode { + fn from(val: QemuDashboardPanel) -> Self { + let comp = VComp::new::(Rc::new(val), None); VNode::from(comp) } } diff --git a/src/pages/page_qemu_status/firewall_panel.rs b/src/pages/page_qemu_status/firewall_panel.rs index 3a30c1b..bcc6213 100644 --- a/src/pages/page_qemu_status/firewall_panel.rs +++ b/src/pages/page_qemu_status/firewall_panel.rs @@ -159,9 +159,9 @@ impl Component for PveQemuFirewallPanel { } } -impl Into for QemuFirewallPanel { - fn into(self) -> VNode { - let comp = VComp::new::(Rc::new(self), None); +impl From for VNode { + fn from(val: QemuFirewallPanel) -> Self { + let comp = VComp::new::(Rc::new(val), None); VNode::from(comp) } } diff --git a/src/pages/page_qemu_status/mod.rs b/src/pages/page_qemu_status/mod.rs index 068b579..bbd4fcf 100644 --- a/src/pages/page_qemu_status/mod.rs +++ b/src/pages/page_qemu_status/mod.rs @@ -177,9 +177,9 @@ impl Component for PvePageQemuStatus { } } -impl Into for PageQemuStatus { - fn into(self) -> VNode { - let comp = VComp::new::(Rc::new(self), None); +impl From for VNode { + fn from(val: PageQemuStatus) -> Self { + let comp = VComp::new::(Rc::new(val), None); VNode::from(comp) } } diff --git a/src/pages/page_qemu_tasks.rs b/src/pages/page_qemu_tasks.rs index 7639b09..bac33a9 100644 --- a/src/pages/page_qemu_tasks.rs +++ b/src/pages/page_qemu_tasks.rs @@ -68,9 +68,9 @@ pub fn PvePageQemuTasks(props: &PageQemuTasks) -> Html { .into() } -impl Into for PageQemuTasks { - fn into(self) -> VNode { - let comp = VComp::new::(Rc::new(self), None); +impl From for VNode { + fn from(val: PageQemuTasks) -> Self { + let comp = VComp::new::(Rc::new(val), None); VNode::from(comp) } } diff --git a/src/pages/page_resources.rs b/src/pages/page_resources.rs index 2d41e35..20bd124 100644 --- a/src/pages/page_resources.rs +++ b/src/pages/page_resources.rs @@ -448,9 +448,9 @@ impl Component for PvePageResources { } } -impl Into for PageResources { - fn into(self) -> VNode { - let comp = VComp::new::(Rc::new(self), None); +impl From for VNode { + fn from(val: PageResources) -> Self { + let comp = VComp::new::(Rc::new(val), None); VNode::from(comp) } } diff --git a/src/pages/page_settings.rs b/src/pages/page_settings.rs index b410b8a..881c219 100644 --- a/src/pages/page_settings.rs +++ b/src/pages/page_settings.rs @@ -48,9 +48,9 @@ impl Component for PvePageSettings { } } -impl Into for PageSettings { - fn into(self) -> VNode { - let comp = VComp::new::(Rc::new(self), None); +impl From for VNode { + fn from(val: PageSettings) -> Self { + let comp = VComp::new::(Rc::new(val), None); VNode::from(comp) } } diff --git a/src/pages/page_storage_status.rs b/src/pages/page_storage_status.rs index 939a7c6..8766afb 100644 --- a/src/pages/page_storage_status.rs +++ b/src/pages/page_storage_status.rs @@ -113,9 +113,9 @@ impl Component for PvePageStorageStatus { } } -impl Into for PageStorageStatus { - fn into(self) -> VNode { - let comp = VComp::new::(Rc::new(self), None); +impl From for VNode { + fn from(val: PageStorageStatus) -> Self { + let comp = VComp::new::(Rc::new(val), None); VNode::from(comp) } } diff --git a/src/pages/page_task_status.rs b/src/pages/page_task_status.rs index 9217e75..75076f5 100644 --- a/src/pages/page_task_status.rs +++ b/src/pages/page_task_status.rs @@ -281,9 +281,9 @@ impl Component for PvePageTaskStatus { } } -impl Into for PageTaskStatus { - fn into(self) -> VNode { - let comp = VComp::new::(Rc::new(self), None); +impl From for VNode { + fn from(val: PageTaskStatus) -> Self { + let comp = VComp::new::(Rc::new(val), None); VNode::from(comp) } } diff --git a/src/widgets/top_nav_bar.rs b/src/widgets/top_nav_bar.rs index c8234f0..128ce3e 100644 --- a/src/widgets/top_nav_bar.rs +++ b/src/widgets/top_nav_bar.rs @@ -195,9 +195,9 @@ impl Component for PveTopNavBar { } } -impl Into for TopNavBar { - fn into(self) -> VNode { - let comp = VComp::new::(Rc::new(self), None); +impl From for VNode { + fn from(val: TopNavBar) -> Self { + let comp = VComp::new::(Rc::new(val), None); VNode::from(comp) } } -- 2.47.3