Fix clippy lints 🎉

This commit is contained in:
Héctor Ramón Jiménez 2023-02-04 12:35:10 +01:00
parent d2825360a7
commit 17470bf7d3
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
2 changed files with 8 additions and 7 deletions

View file

@ -967,7 +967,7 @@ pub fn draw<Renderer>(
} else { } else {
theme.value_color(style) theme.value_color(style)
}, },
font: font, font,
bounds: Rectangle { bounds: Rectangle {
y: text_bounds.center_y(), y: text_bounds.center_y(),
width: f32::INFINITY, width: f32::INFINITY,

View file

@ -7,6 +7,7 @@ use iced_native::{Color, Font, Rectangle, Size};
use rustc_hash::{FxHashMap, FxHashSet}; use rustc_hash::{FxHashMap, FxHashSet};
use std::borrow::Cow; use std::borrow::Cow;
use std::cell::RefCell; use std::cell::RefCell;
use std::collections::hash_map;
use std::hash::{BuildHasher, Hash, Hasher}; use std::hash::{BuildHasher, Hash, Hasher};
use std::sync::Arc; use std::sync::Arc;
use twox_hash::RandomXxHashBuilder64; use twox_hash::RandomXxHashBuilder64;
@ -70,7 +71,7 @@ impl Pipeline {
let (locale, mut db) = heads.fonts.into_locale_and_db(); let (locale, mut db) = heads.fonts.into_locale_and_db();
db.load_font_source(glyphon::fontdb::Source::Binary(Arc::new( db.load_font_source(glyphon::fontdb::Source::Binary(Arc::new(
bytes.to_owned(), bytes.into_owned(),
))); )));
self.system = Some( self.system = Some(
@ -241,7 +242,7 @@ impl Pipeline {
fields.fonts, fields.fonts,
Key { Key {
content, content,
size: size, size,
font, font,
bounds, bounds,
color: Color::BLACK, color: Color::BLACK,
@ -275,7 +276,7 @@ impl Pipeline {
fields.fonts, fields.fonts,
Key { Key {
content, content,
size: size, size,
font, font,
bounds, bounds,
color: Color::BLACK, color: Color::BLACK,
@ -344,9 +345,9 @@ impl<'a> Cache<'a> {
hasher.finish() hasher.finish()
}; };
if !self.entries.contains_key(&hash) { if let hash_map::Entry::Vacant(entry) = self.entries.entry(hash) {
let metrics = glyphon::Metrics::new(key.size, key.size * 1.2); let metrics = glyphon::Metrics::new(key.size, key.size * 1.2);
let mut buffer = glyphon::Buffer::new(&fonts, metrics); let mut buffer = glyphon::Buffer::new(fonts, metrics);
buffer.set_size(key.bounds.width, key.bounds.height); buffer.set_size(key.bounds.width, key.bounds.height);
buffer.set_text( buffer.set_text(
@ -363,7 +364,7 @@ impl<'a> Cache<'a> {
}), }),
); );
let _ = self.entries.insert(hash, buffer); let _ = entry.insert(buffer);
} }
let _ = self.recently_used.insert(hash); let _ = self.recently_used.insert(hash);