tirbofish/dropbear · commit
ed57d911d4ccd8fafc04c51a428dc479887e991c
worked on async and channels, with the dependency checking working perfectly :)
Signature present but could not be verified.
Unverified
@@ -58,6 +58,7 @@ flate2 = "1.1" reqwest = { version = "0.11", features = ["stream"] } tar = "0.4" async-trait = "0.1" +futures-util = "0.3" gltf = "1" thiserror = "2.0" @@ -68,7 +68,7 @@ pub struct LazyAdoptedEntity { impl LazyAdoptedEntity { /// Create a LazyAdoptedEntity from a file path (can be run on background thread) pub async fn from_file(path: &PathBuf, label: Option<&str>) -> anyhow::Result<Self> { - let buffer = std::fs::read(path)?; + let buffer = tokio::fs::read(path).await?; Self::from_memory(buffer, label).await } @@ -407,14 +407,14 @@ impl App { /// - setup: A closure that can initialise the first scenes, such as a menu or the game itself. /// It takes an input of a scene manager and an input manager, and expects you to return back the changed /// managers. - pub fn run<F>(config: WindowConfiguration, app_name: &str, setup: F) -> anyhow::Result<()> + pub async fn run<F>(config: WindowConfiguration, app_name: &str, setup: F) -> anyhow::Result<()> where F: FnOnce(scene::Manager, input::Manager) -> (scene::Manager, input::Manager), { let log_dir = app_dirs2::app_root(AppDataType::UserData, &config.app_info) .expect("Failed to get app data directory") .join("logs"); - std::fs::create_dir_all(&log_dir).expect("Failed to create log dir"); + tokio::fs::create_dir_all(&log_dir).await.expect("Failed to create log dir"); let datetime_str = Local::now().format("%Y-%m-%d_%H-%M-%S"); let log_filename = format!("{}.{}.log", app_name, datetime_str);
Large diffs are not rendered by default. Showing the first 50 of 914 lines. Show full diff