improv(segmented-button): set icons with impl Into<Icon>
This commit is contained in:
parent
31ea71deef
commit
16c1265535
2 changed files with 4 additions and 4 deletions
|
|
@ -103,8 +103,8 @@ where
|
|||
/// .build()
|
||||
/// ```
|
||||
#[allow(clippy::must_use_candidate, clippy::return_self_not_must_use)]
|
||||
pub fn icon(mut self, icon: Icon) -> Self {
|
||||
self.model.0.icon_set(self.id, icon);
|
||||
pub fn icon(mut self, icon: impl Into<Icon>) -> Self {
|
||||
self.model.0.icon_set(self.id, icon.into());
|
||||
self
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -89,8 +89,8 @@ where
|
|||
/// model.insert().text("Item A").icon(IconSource::from("icon-a"));
|
||||
/// ```
|
||||
#[allow(clippy::must_use_candidate, clippy::return_self_not_must_use)]
|
||||
pub fn icon(self, icon: Icon) -> Self {
|
||||
self.model.icon_set(self.id, icon);
|
||||
pub fn icon(self, icon: impl Into<Icon>) -> Self {
|
||||
self.model.icon_set(self.id, icon.into());
|
||||
self
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue