Improve Icon::new to support impl Into<IconName>

This commit is contained in:
Jason Lee 2024-07-23 09:56:57 +08:00
parent 1eb44c4f1a
commit 8609968ac2

View file

@ -117,7 +117,8 @@ impl Clone for Icon {
}
impl Icon {
pub fn new(name: IconName) -> Self {
pub fn new(name: impl Into<IconName>) -> Self {
let name: IconName = name.into();
Self::default().path(name.path())
}