mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-25 01:28:12 +08:00
Make ResourceStorage trait &self-based and remove 'static requirement (#4188)
* Make ResourceStorage trait &self-based with elided-lifetime ResourceFuture * Adress review comments
This commit is contained in:
@@ -85,11 +85,11 @@ impl EditorWrapper {
|
||||
_ => unreachable!(),
|
||||
};
|
||||
|
||||
let storage: Box<dyn ResourceStorage> = match OpfsResourceStorage::load("resources").await {
|
||||
Ok(storage) => Box::new(storage),
|
||||
let storage: std::sync::Arc<dyn ResourceStorage> = match OpfsResourceStorage::load("resources").await {
|
||||
Ok(storage) => std::sync::Arc::new(storage),
|
||||
Err(error) => {
|
||||
log::error!("Failed to open OPFS resource storage, falling back to in-memory: {error:?}");
|
||||
Box::new(graph_craft::application_io::resource::HashMapResourceStorage::new())
|
||||
std::sync::Arc::new(graph_craft::application_io::resource::HashMapResourceStorage::new())
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user