From 4b420094b17ad291b7ad5f36016408f2b87cfede Mon Sep 17 00:00:00 2001 From: -karlos- Date: Thu, 30 Nov 2023 19:36:38 +0100 Subject: [PATCH] Ok ok, before push, I will now always run cargo fmt --all -- --check --- .vscode/tasks.json | 18 ++++++++++++++++++ src/http_assets.rs | 4 ++-- src/tilemap.rs | 2 +- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 669aff4..c0854f7 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -37,6 +37,24 @@ "group": { "kind": "build" } + }, + { + "label": "fmt", + "type": "shell", + "command": "cargo fmt --all -- --check", + "problemMatcher": [], + "group": { + "kind": "test" + } + }, + { + "type": "cargo", + "command": "test", + "problemMatcher": [ + "$rustc" + ], + "group": "test", + "label": "rust: cargo test" } ] } \ No newline at end of file diff --git a/src/http_assets.rs b/src/http_assets.rs index 0ab406b..db03e1e 100644 --- a/src/http_assets.rs +++ b/src/http_assets.rs @@ -41,7 +41,7 @@ impl AssetReader for HttpAssetReader { let cache_path = self.cache_path.as_ref().map(|p| p.join(path)); // Load from cache if the asset exists there. if let Some(cache_path) = &cache_path { - info!("READ: {:?}",path); + info!("READ: {:?}", path); if cache_path.exists() { let file = File::open(&cache_path).await?; return Ok(Box::new(file) as Box); @@ -78,7 +78,7 @@ impl AssetReader for HttpAssetReader { if let Some(cache_path) = cache_path { // Write asset to cache, but ensure only one HttpAssetReader writes at any given point in time if self.sync.write().unwrap().insert(cache_path.clone()) { - debug!("write: {:?}",path); + debug!("write: {:?}", path); async_fs::create_dir_all(cache_path.parent().unwrap()).await?; async_fs::write(cache_path, &bytes).await?; } diff --git a/src/tilemap.rs b/src/tilemap.rs index c433961..7880e40 100644 --- a/src/tilemap.rs +++ b/src/tilemap.rs @@ -36,7 +36,7 @@ impl TileMap { let oob = offset.length_squared() > radius.length_squared(); if oob { if let Some(entity) = commands.get_entity(*tile) { - debug!("despawn: {}/{}",x,y); + debug!("despawn: {}/{}", x, y); entity.despawn_recursive(); } }