diff --git a/src/icon_theme.rs b/src/icon_theme.rs index 4a25d615..6d8dfc89 100644 --- a/src/icon_theme.rs +++ b/src/icon_theme.rs @@ -3,20 +3,21 @@ //! Select the preferred icon theme. +use std::borrow::Cow; use std::cell::RefCell; thread_local! { /// The fallback icon theme to search if no icon theme was specified. - pub(crate) static DEFAULT: RefCell = RefCell::new(String::from("Cosmic")); + pub(crate) static DEFAULT: RefCell> = RefCell::new("Cosmic".into()); } /// The fallback icon theme to search if no icon theme was specified. #[must_use] pub fn default() -> String { - DEFAULT.with(|f| f.borrow().clone()) + DEFAULT.with(|theme| theme.borrow().to_string()) } /// Set the fallback icon theme to search when loading system icons. -pub fn set_default(name: impl Into) { - DEFAULT.with(|f| *f.borrow_mut() = name.into()); +pub fn set_default(name: impl Into>) { + DEFAULT.with(|theme| *theme.borrow_mut() = name.into()); }