From: Shannon Sterz <s.sterz@proxmox.com>
To: yew-devel@lists.proxmox.com
Subject: [PATCH yew-mobile-gui 05/20] tree-wide: implement the `From` trait instead of the `Into` trait
Date: Fri, 8 May 2026 17:05:20 +0200 [thread overview]
Message-ID: <20260508150535.420205-6-s.sterz@proxmox.com> (raw)
In-Reply-To: <20260508150535.420205-1-s.sterz@proxmox.com>
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 <s.sterz@proxmox.com>
---
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<VNode> for PageClusterFirewall {
- fn into(self) -> VNode {
- let comp = VComp::new::<PvePageClusterFirewall>(Rc::new(self), None);
+impl From<PageClusterFirewall> for VNode {
+ fn from(val: PageClusterFirewall) -> Self {
+ let comp = VComp::new::<PvePageClusterFirewall>(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<VNode> for PageConfiguration {
- fn into(self) -> VNode {
- let comp = VComp::new::<PvePageConfiguration>(Rc::new(self), None);
+impl From<PageConfiguration> for VNode {
+ fn from(val: PageConfiguration) -> Self {
+ let comp = VComp::new::<PvePageConfiguration>(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<VNode> for PageDashboard {
- fn into(self) -> VNode {
- let comp = VComp::new::<PvePageDashboard>(Rc::new(self), None);
+impl From<PageDashboard> for VNode {
+ fn from(val: PageDashboard) -> Self {
+ let comp = VComp::new::<PvePageDashboard>(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<VNode> for PageLogin {
- fn into(self) -> VNode {
- let comp = VComp::new::<PvePageLogin>(Rc::new(self), None);
+impl From<PageLogin> for VNode {
+ fn from(val: PageLogin) -> Self {
+ let comp = VComp::new::<PvePageLogin>(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<VNode> for LxcDashboardPanel {
- fn into(self) -> VNode {
- let comp = VComp::new::<PveLxcDashboardPanel>(Rc::new(self), None);
+impl From<LxcDashboardPanel> for VNode {
+ fn from(val: LxcDashboardPanel) -> Self {
+ let comp = VComp::new::<PveLxcDashboardPanel>(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<VNode> for PageLxcStatus {
- fn into(self) -> VNode {
- let comp = VComp::new::<PvePageLxcStatus>(Rc::new(self), None);
+impl From<PageLxcStatus> for VNode {
+ fn from(val: PageLxcStatus) -> Self {
+ let comp = VComp::new::<PvePageLxcStatus>(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<VNode> for PageLxcTasks {
- fn into(self) -> VNode {
- let comp = VComp::new::<PvePageLxcTasks>(Rc::new(self), None);
+impl From<PageLxcTasks> for VNode {
+ fn from(val: PageLxcTasks) -> Self {
+ let comp = VComp::new::<PvePageLxcTasks>(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<VNode> for NodeDashboardPanel {
- fn into(self) -> VNode {
- let comp = VComp::new::<PveNodeDashboardPanel>(Rc::new(self), None);
+impl From<NodeDashboardPanel> for VNode {
+ fn from(val: NodeDashboardPanel) -> Self {
+ let comp = VComp::new::<PveNodeDashboardPanel>(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<VNode> for PageNodeStatus {
- fn into(self) -> VNode {
- let comp = VComp::new::<PvePageNodeStatus>(Rc::new(self), None);
+impl From<PageNodeStatus> for VNode {
+ fn from(val: PageNodeStatus) -> Self {
+ let comp = VComp::new::<PvePageNodeStatus>(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<VNode> for PageNodeTasks {
- fn into(self) -> VNode {
- let comp = VComp::new::<PvePageNodeTasks>(Rc::new(self), None);
+impl From<PageNodeTasks> for VNode {
+ fn from(val: PageNodeTasks) -> Self {
+ let comp = VComp::new::<PvePageNodeTasks>(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<VNode> for QemuDashboardPanel {
- fn into(self) -> VNode {
- let comp = VComp::new::<PveQemuDashboardPanel>(Rc::new(self), None);
+impl From<QemuDashboardPanel> for VNode {
+ fn from(val: QemuDashboardPanel) -> Self {
+ let comp = VComp::new::<PveQemuDashboardPanel>(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<VNode> for QemuFirewallPanel {
- fn into(self) -> VNode {
- let comp = VComp::new::<PveQemuFirewallPanel>(Rc::new(self), None);
+impl From<QemuFirewallPanel> for VNode {
+ fn from(val: QemuFirewallPanel) -> Self {
+ let comp = VComp::new::<PveQemuFirewallPanel>(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<VNode> for PageQemuStatus {
- fn into(self) -> VNode {
- let comp = VComp::new::<PvePageQemuStatus>(Rc::new(self), None);
+impl From<PageQemuStatus> for VNode {
+ fn from(val: PageQemuStatus) -> Self {
+ let comp = VComp::new::<PvePageQemuStatus>(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<VNode> for PageQemuTasks {
- fn into(self) -> VNode {
- let comp = VComp::new::<PvePageQemuTasks>(Rc::new(self), None);
+impl From<PageQemuTasks> for VNode {
+ fn from(val: PageQemuTasks) -> Self {
+ let comp = VComp::new::<PvePageQemuTasks>(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<VNode> for PageResources {
- fn into(self) -> VNode {
- let comp = VComp::new::<PvePageResources>(Rc::new(self), None);
+impl From<PageResources> for VNode {
+ fn from(val: PageResources) -> Self {
+ let comp = VComp::new::<PvePageResources>(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<VNode> for PageSettings {
- fn into(self) -> VNode {
- let comp = VComp::new::<PvePageSettings>(Rc::new(self), None);
+impl From<PageSettings> for VNode {
+ fn from(val: PageSettings) -> Self {
+ let comp = VComp::new::<PvePageSettings>(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<VNode> for PageStorageStatus {
- fn into(self) -> VNode {
- let comp = VComp::new::<PvePageStorageStatus>(Rc::new(self), None);
+impl From<PageStorageStatus> for VNode {
+ fn from(val: PageStorageStatus) -> Self {
+ let comp = VComp::new::<PvePageStorageStatus>(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<VNode> for PageTaskStatus {
- fn into(self) -> VNode {
- let comp = VComp::new::<PvePageTaskStatus>(Rc::new(self), None);
+impl From<PageTaskStatus> for VNode {
+ fn from(val: PageTaskStatus) -> Self {
+ let comp = VComp::new::<PvePageTaskStatus>(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<VNode> for TopNavBar {
- fn into(self) -> VNode {
- let comp = VComp::new::<PveTopNavBar>(Rc::new(self), None);
+impl From<TopNavBar> for VNode {
+ fn from(val: TopNavBar) -> Self {
+ let comp = VComp::new::<PveTopNavBar>(Rc::new(val), None);
VNode::from(comp)
}
}
--
2.47.3
next prev parent reply other threads:[~2026-05-08 15:06 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-08 15:05 [PATCH yew-comp/yew-mobile-gui 00/20] firewall tabs and clean up for pve-yew-mobile-gui Shannon Sterz
2026-05-08 15:05 ` [PATCH yew-comp 01/20] firewall rules panel: correct the url for the pve cluster firewall rules Shannon Sterz
2026-05-08 15:05 ` [PATCH yew-mobile-gui 02/20] cargo.toml: globally ignore certain clippy lints Shannon Sterz
2026-05-08 15:05 ` [PATCH yew-mobile-gui 03/20] main: avoid unnecessary clones Shannon Sterz
2026-05-08 15:05 ` [PATCH yew-mobile-gui 04/20] tree-wide: collapse if statements Shannon Sterz
2026-05-08 15:05 ` Shannon Sterz [this message]
2026-05-08 15:05 ` [PATCH yew-mobile-gui 06/20] tree-wide: implement `Default` for types with an `new()` constructor Shannon Sterz
2026-05-08 15:05 ` [PATCH yew-mobile-gui 07/20] tree-wide: remove unnecessary lazy evaluations Shannon Sterz
2026-05-08 15:05 ` [PATCH yew-mobile-gui 08/20] tree-wide: remove needless borrows Shannon Sterz
2026-05-08 15:05 ` [PATCH yew-mobile-gui 09/20] configuration page: remove redundant static lifetimes Shannon Sterz
2026-05-08 15:05 ` [PATCH yew-mobile-gui 10/20] resources/configuration page: remove useless `.into()` calls Shannon Sterz
2026-05-08 15:05 ` [PATCH yew-mobile-gui 11/20] tree-wide: fix several clippy lints Shannon Sterz
2026-05-08 15:05 ` [PATCH yew-mobile-gui 12/20] dashboard: use proper plural translation string instead of "CPU(s)" Shannon Sterz
2026-05-08 15:05 ` [PATCH yew-mobile-gui 13/20] configuration: clarify that "Firewall" shows the cluster's firewall Shannon Sterz
2026-05-08 15:05 ` [PATCH yew-mobile-gui 14/20] cluster/qemu firewall: use rules panel and comment out unused tabs Shannon Sterz
2026-05-08 15:05 ` [PATCH yew-mobile-gui 15/20] lxc page: align layout for lxc guest with qemu guests Shannon Sterz
2026-05-08 15:43 ` Shannon Sterz
2026-05-08 15:05 ` [PATCH yew-mobile-gui 16/20] lxc: add support for a rudimentary firewall tab for lxc guests Shannon Sterz
2026-05-08 15:05 ` [PATCH yew-mobile-gui 17/20] node status: align layout for node status with guest pages Shannon Sterz
2026-05-08 15:05 ` [PATCH yew-mobile-gui 18/20] node: add a rudimentary firewall tab for cluster nodes Shannon Sterz
2026-05-08 15:05 ` [PATCH yew-mobile-gui 19/20] api types: remove unused file Shannon Sterz
2026-05-08 15:05 ` [PATCH yew-mobile-gui 20/20] resources page: map subscription level analogous to dashboard Shannon Sterz
2026-05-08 15:22 ` Shan Shaji
2026-05-08 15:59 ` Superseded: Re: [PATCH yew-comp/yew-mobile-gui 00/20] firewall tabs and clean up for pve-yew-mobile-gui Shannon Sterz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260508150535.420205-6-s.sterz@proxmox.com \
--to=s.sterz@proxmox.com \
--cc=yew-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox