summaryrefslogtreecommitdiff
path: root/src/image.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-05-11 10:50:30 +0200
committerLaurenz <laurmaedje@gmail.com>2023-05-11 10:50:30 +0200
commit47dff3765de863554ca296448555599fc50d4a8a (patch)
treef632073bd800466d94dae7d19b1d4e28e80ff743 /src/image.rs
parentd9ba84085e36036409c919cff2e3eb3d126e3bb3 (diff)
Remove 'static bound on `World`
Thanks to improvements in comemo, tracked types don't need to be 'static anymore. This means that the 'static bound on the `World` is now lifted and that the `Route` doesn't need to use unsafe code anymore to manage its lifetime.
Diffstat (limited to 'src/image.rs')
-rw-r--r--src/image.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/image.rs b/src/image.rs
index d78c7428..f9974599 100644
--- a/src/image.rs
+++ b/src/image.rs
@@ -53,7 +53,7 @@ impl Image {
pub fn with_fonts(
data: Buffer,
format: ImageFormat,
- world: Tracked<dyn World>,
+ world: Tracked<dyn World + '_>,
fallback_family: Option<&str>,
alt: Option<EcoString>,
) -> StrResult<Self> {
@@ -240,7 +240,7 @@ fn decode_svg(data: &Buffer) -> StrResult<Arc<DecodedImage>> {
#[comemo::memoize]
fn decode_svg_with_fonts(
data: &Buffer,
- world: Tracked<dyn World>,
+ world: Tracked<dyn World + '_>,
fallback_family: Option<&str>,
) -> StrResult<Arc<DecodedImage>> {
let mut opts = usvg::Options::default();
@@ -269,7 +269,7 @@ fn decode_svg_with_fonts(
/// Discover and load the fonts referenced by an SVG.
fn load_svg_fonts(
tree: &usvg::Tree,
- world: Tracked<dyn World>,
+ world: Tracked<dyn World + '_>,
fallback_family: Option<&str>,
) -> fontdb::Database {
let mut referenced = BTreeMap::<EcoString, bool>::new();