clippy
This commit is contained in:
parent
0ce914b57a
commit
76930d8624
58 changed files with 173 additions and 183 deletions
|
|
@ -17,7 +17,7 @@ const MONO_FAMILY_DEFAULT: &str = "Noto Sans Mono";
|
|||
const SANS_FAMILY_DEFAULT: &str = "Open Sans";
|
||||
|
||||
/// Stores static strings of the family names for `iced::Font` compatibility.
|
||||
pub static FAMILY_MAP: LazyLock<Mutex<BTreeSet<&'static str>>> = LazyLock::new(|| Mutex::default());
|
||||
pub static FAMILY_MAP: LazyLock<Mutex<BTreeSet<&'static str>>> = LazyLock::new(Mutex::default);
|
||||
|
||||
pub static COSMIC_TK: LazyLock<RwLock<CosmicTk>> = LazyLock::new(|| {
|
||||
RwLock::new(
|
||||
|
|
@ -152,8 +152,7 @@ impl From<FontConfig> for iced::Font {
|
|||
let mut family_map = FAMILY_MAP.lock().unwrap();
|
||||
|
||||
let name: &'static str = family_map
|
||||
.get(font.family.as_str())
|
||||
.map(|&x| x)
|
||||
.get(font.family.as_str()).copied()
|
||||
.unwrap_or_else(|| {
|
||||
let value = font.family.clone().leak();
|
||||
family_map.insert(value);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue