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 3A2261FF15E for ; Tue, 14 Jan 2025 10:10:11 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 11B8410437; Tue, 14 Jan 2025 10:09:54 +0100 (CET) From: Shannon Sterz To: yew-devel@lists.proxmox.com Date: Tue, 14 Jan 2025 10:09:38 +0100 Message-Id: <20250114090940.29366-1-s.sterz@proxmox.com> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.083 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 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [rust-lang.github.io] URIBL_SBL_A 0.1 Contains URL's A record listed in the Spamhaus SBL blocklist [185.199.109.153, 185.199.108.153, 185.199.110.153, 185.199.111.153] Subject: [yew-devel] [PATCH yew-comp 1/3] tree wide: switch from `Into` to `From` implementations where possible X-BeenThere: yew-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Yew framework devel list at Proxmox List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Yew framework devel list at Proxmox Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: yew-devel-bounces@lists.proxmox.com Sender: "yew-devel" this is more flexible as a `From` implementation gives us an `Into` implementation for free. fixes the clippy ling `from_over_into` [1]. [1]: https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into Signed-off-by: Shannon Sterz --- src/configuration/network_edit.rs | 6 +++--- src/configuration/network_view.rs | 6 +++--- src/rrd_graph_new.rs | 6 +++--- src/rrd_timeframe_selector.rs | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/configuration/network_edit.rs b/src/configuration/network_edit.rs index 84a9380..b97b86a 100644 --- a/src/configuration/network_edit.rs +++ b/src/configuration/network_edit.rs @@ -369,9 +369,9 @@ impl Component for ProxmoxNetworkEdit { } } -impl Into for NetworkEdit { - fn into(self) -> VNode { - let comp = VComp::new::(Rc::new(self), None); +impl From for VNode { + fn from(val: NetworkEdit) -> Self { + let comp = VComp::new::(Rc::new(val), None); VNode::from(comp) } } diff --git a/src/configuration/network_view.rs b/src/configuration/network_view.rs index cc2faae..fa9f985 100644 --- a/src/configuration/network_view.rs +++ b/src/configuration/network_view.rs @@ -319,9 +319,9 @@ impl LoadableComponent for ProxmoxNetworkView { } } -impl Into for NetworkView { - fn into(self) -> VNode { - let comp = VComp::new::>(Rc::new(self), None); +impl From for VNode { + fn from(val: NetworkView) -> Self { + let comp = VComp::new::>(Rc::new(val), None); VNode::from(comp) } } diff --git a/src/rrd_graph_new.rs b/src/rrd_graph_new.rs index 21890a1..2c77a38 100644 --- a/src/rrd_graph_new.rs +++ b/src/rrd_graph_new.rs @@ -1030,9 +1030,9 @@ impl Component for PwtRRDGraph { } } -impl Into for RRDGraph { - fn into(self) -> VNode { - let comp = VComp::new::(Rc::new(self), None); +impl From for VNode { + fn from(val: RRDGraph) -> Self { + let comp = VComp::new::(Rc::new(val), None); VNode::from(comp) } } diff --git a/src/rrd_timeframe_selector.rs b/src/rrd_timeframe_selector.rs index a027046..d674f7c 100644 --- a/src/rrd_timeframe_selector.rs +++ b/src/rrd_timeframe_selector.rs @@ -233,9 +233,9 @@ impl Component for PwtRRDTimeframeSelector { } } -impl Into for RRDTimeframeSelector { - fn into(self) -> VNode { - let comp = VComp::new::(Rc::new(self), None); +impl From for VNode { + fn from(val: RRDTimeframeSelector) -> Self { + let comp = VComp::new::(Rc::new(val), None); VNode::from(comp) } } -- 2.39.5 _______________________________________________ yew-devel mailing list yew-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/yew-devel