description_list: Update label_width type to accept any Into<DefiniteLength>. (#729)

This commit is contained in:
Jason Lee 2025-03-24 15:29:50 +08:00 committed by GitHub
parent ffa36c1c5b
commit 12e3678e55
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -140,8 +140,8 @@ impl DescriptionList {
/// Set the width of the label, only works for horizontal layout.
///
/// Default is `120px`.
pub fn label_width(mut self, label_width: DefiniteLength) -> Self {
self.label_width = label_width;
pub fn label_width(mut self, label_width: impl Into<DefiniteLength>) -> Self {
self.label_width = label_width.into();
self
}