clippy: fix warnings in components/gfx (#31560)

* clippy: fix warnings in components/gfx

* refactor: switched the order of impl so that its intent is clearer

* fix: add font context default in other platforms
This commit is contained in:
eri 2024-03-08 08:10:15 +01:00 committed by GitHub
parent 1771f9a9a1
commit 88033bd654
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 195 additions and 234 deletions

View file

@ -34,13 +34,13 @@ struct TestFontSource {
impl TestFontSource {
fn new() -> TestFontSource {
let mut csstest_ascii = FontTemplates::new();
let mut csstest_ascii = FontTemplates::default();
Self::add_face(&mut csstest_ascii, "csstest-ascii", None);
let mut csstest_basic = FontTemplates::new();
let mut csstest_basic = FontTemplates::default();
Self::add_face(&mut csstest_basic, "csstest-basic-regular", None);
let mut fallback = FontTemplates::new();
let mut fallback = FontTemplates::default();
Self::add_face(&mut fallback, "csstest-basic-regular", Some("fallback"));
let mut families = HashMap::new();
@ -49,7 +49,7 @@ impl TestFontSource {
families.insert(fallback_font_families(None)[0].to_owned(), fallback);
TestFontSource {
handle: FontContextHandle::new(),
handle: FontContextHandle::default(),
families,
find_font_count: Rc::new(Cell::new(0)),
}

View file

@ -35,7 +35,7 @@ fn test_font_template_descriptor() {
)
.unwrap();
let context = FontContextHandle::new();
let context = FontContextHandle::default();
template.descriptor(&context).unwrap()
}