Make get_collection_from_file async
This commit is contained in:
parent
183efaa047
commit
f1751882be
4 changed files with 83 additions and 53 deletions
|
@ -4,10 +4,7 @@ mod persistence ;
|
|||
mod ui ;
|
||||
mod utility ;
|
||||
|
||||
use {
|
||||
gtk4 :: { gio :: spawn_blocking , glib :: * } ,
|
||||
libadwaita :: { * , prelude :: * } ,
|
||||
} ;
|
||||
use { gtk4 :: glib :: * , libadwaita :: { * , prelude :: * } } ;
|
||||
|
||||
use crate :: { error :: { * , ZoodexError :: * } , persistence :: * , ui :: * } ;
|
||||
|
||||
|
@ -28,10 +25,8 @@ fn on_activate ( app : & Application ) {
|
|||
spawn_future_local ( async move {
|
||||
async_unit_result_context (
|
||||
async {
|
||||
let collection = spawn_blocking ( ||
|
||||
get_collection_from_file () ) . await ? ? ;
|
||||
let collection = get_collection_from_file () . await ? ;
|
||||
ui . render_collection (collection) ;
|
||||
|
||||
Ok (())
|
||||
} ,
|
||||
|error| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue