From 71281a5d7938b2c3bc1a0960279286c68ce508b1 Mon Sep 17 00:00:00 2001 From: Christopher Serr Date: Wed, 29 Mar 2023 22:29:09 +0200 Subject: [PATCH 1/2] Fix `FontSystem::new_with_locale_and_db` Signature It turns out that the `no_std` version of `FontSystem::new_with_locale_and_db` doesn't match the `std` version. This fixes that. --- examples/editor-libcosmic/src/text_box.rs | 6 ++++-- src/font/system/no_std.rs | 7 ++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/examples/editor-libcosmic/src/text_box.rs b/examples/editor-libcosmic/src/text_box.rs index 91c8d69..e97a6ad 100644 --- a/examples/editor-libcosmic/src/text_box.rs +++ b/examples/editor-libcosmic/src/text_box.rs @@ -10,7 +10,7 @@ use cosmic::{ mouse::{self, Button, Event as MouseEvent, ScrollDelta}, renderer, widget::{self, tree, Widget}, - Padding, {Color, Element, Length, Point, Rectangle, Shell, Size}, + Color, Element, Length, Padding, Point, Rectangle, Shell, Size, }, theme::{Theme, ThemeType}, }; @@ -227,7 +227,9 @@ where // Scale metrics let metrics = editor.buffer().metrics(); - editor.buffer_mut().set_metrics(metrics.scale(style.scale_factor as f32)); + editor + .buffer_mut() + .set_metrics(metrics.scale(style.scale_factor as f32)); // Set size editor.buffer_mut().set_size(image_w as f32, image_h as f32); diff --git a/src/font/system/no_std.rs b/src/font/system/no_std.rs index e4078b1..f981061 100644 --- a/src/font/system/no_std.rs +++ b/src/font/system/no_std.rs @@ -28,11 +28,8 @@ impl FontSystem { Self { locale, db } } - pub fn new_with_locale_and_db(locale: &str, db: fontdb::Database) -> Self { - Self { - locale: locale.to_string(), - db, - } + pub fn new_with_locale_and_db(locale: String, db: fontdb::Database) -> Self { + Self { locale, db } } pub fn locale(&self) -> &str { From 3b6373d0f484b4ed2d5b35ccda55b70e51a810da Mon Sep 17 00:00:00 2001 From: Christopher Serr Date: Thu, 30 Mar 2023 20:11:45 +0200 Subject: [PATCH 2/2] Temporarily allow `syn` v1.0 in `cargo deny` This temporarily allows `syn` v1.0 to be in the dependency tree as the whole ecosystem is currently transitioning to `syn` v2.0. This process however may take a while. The entry in the `deny.toml` should be removed once all dependencies transitioned. --- deny.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/deny.toml b/deny.toml index 5643982..60ede87 100644 --- a/deny.toml +++ b/deny.toml @@ -243,6 +243,9 @@ deny = [ # Certain crates/versions that will be skipped when doing duplicate detection. skip = [ + # TODO: We allow syn 1.0 during the transition to syn 2.0. Remove this when + # syn is not in the dependency tree anymore. + { name = "syn", version = "1" } #{ name = "ansi_term", version = "=0.11.0" }, ] # Similarly to `skip` allows you to skip certain crates during duplicate