[pdm-devel] [PATCH proxmox-yew-widget-toolkit 1/1] data table: fix using str with get_property
Stefan Hanreich
s.hanreich at proxmox.com
Wed Aug 20 13:58:08 CEST 2025
Without the ?Sized trait bound, one cannot use str as the type for
get_property. Since we do not need the implicit trait bound here, we
can make the Sized bound optional, thus enabling the usage of str for
get_property.
Signed-off-by: Stefan Hanreich <s.hanreich at proxmox.com>
---
src/widget/data_table/column.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/widget/data_table/column.rs b/src/widget/data_table/column.rs
index 016be99..1b95c3e 100644
--- a/src/widget/data_table/column.rs
+++ b/src/widget/data_table/column.rs
@@ -300,7 +300,7 @@ impl<T: 'static> DataTableColumn<T> {
/// Builder style method to set a get_property_fn for renderer and sorter
/// the given fn must return a reference
- pub fn get_property<E: Ord + std::fmt::Display>(
+ pub fn get_property<E: Ord + std::fmt::Display + ?Sized>(
self,
get_property_fn: impl 'static + Fn(&T) -> &E,
) -> Self {
--
2.47.2
More information about the pdm-devel
mailing list