♻️ Refactor mutability modifiers in wasm

This commit is contained in:
alonso.torres 2025-07-01 12:46:50 +02:00
parent f0f01af55c
commit 3d374e8e97
12 changed files with 155 additions and 131 deletions

View file

@ -1,6 +1,6 @@
use crate::skia::Image;
use crate::uuid::Uuid;
use crate::with_state;
use crate::with_state_mut;
use crate::STATE;
use std::collections::HashSet;
@ -24,10 +24,10 @@ pub fn uuid_from_u32(id: [u32; 4]) -> Uuid {
}
pub fn get_image(image_id: &Uuid) -> Option<&Image> {
with_state!(state, { state.render_state().images.get(image_id) })
with_state_mut!(state, { state.render_state_mut().images.get(image_id) })
}
// FIXME: move to a different place ?
pub fn get_fallback_fonts() -> &'static HashSet<String> {
with_state!(state, { state.render_state().fonts().get_fallback() })
with_state_mut!(state, { state.render_state().fonts().get_fallback() })
}