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 6D20E1FF17C for ; Wed, 20 Aug 2025 12:45:00 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 3D89686AD; Wed, 20 Aug 2025 12:46:44 +0200 (CEST) Message-ID: <467fb7cc-a03c-46d0-86f4-6cffdd7244ad@proxmox.com> Date: Wed, 20 Aug 2025 12:46:11 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Dominik Csapak , Proxmox Datacenter Manager development discussion References: <20250819132538.223207-1-s.hanreich@proxmox.com> <3518c038-8cbf-4df8-a752-54570d1b22bb@proxmox.com> <7df27407-9651-4802-8159-d0bed2594497@proxmox.com> Content-Language: en-US From: Stefan Hanreich In-Reply-To: X-SPAM-LEVEL: Spam detection results: 0 AWL 0.705 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 KAM_SHORT 0.001 Use of a URL Shortener for very short URL SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pdm-devel] [PATCH proxmox-yew-widget-toolkit 1/1] data table: add get_property helper for displaying optional values X-BeenThere: pdm-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Datacenter Manager development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pdm-devel-bounces@lists.proxmox.com Sender: "pdm-devel" On 8/20/25 12:33 PM, Dominik Csapak wrote: [snip] > if you have an Option<&str> you can omit the .as_deref() > ``` > Some("foo").unwrap_or("") > ``` > > works > I have an Option, where it doesn't work afaict (without cloning). [snip] >>>> {{get_property_fn(item).map(VNode::from).unwrap_or_default()}}, >>> >>> mhmm since we require the Display trait as boundary, wouldn't a >>> to_string() be better here? The default for VNode is a VList, but an >>> empty string produces a VText >> >> this allocates a string for every cell, whereas VList doesn't and both >> are effectively the same (no HTML produced) > > yes it does, VNode::from for T which impl ToString (implicitly by > Display) uses to_string too: > > https://docs.rs/yew/latest/src/yew/virtual_dom/vnode.rs.html#164-166 Ah sorry, I though you were talking about the Default case. Nevertheless it would still make sense to use the Yew provided implementation then? _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel