From 6f8dcea2a5e41ca94ae40636a7096e7ccb525311 Mon Sep 17 00:00:00 2001 From: ice_iix Date: Fri, 24 Dec 2021 09:13:17 -0800 Subject: [PATCH 1/5] Update to Rust 1.57.0 --- .github/workflows/build.yaml | 8 ++++---- README.md | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index a567a1e..a0ae137 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -11,7 +11,7 @@ jobs: uses: actions-rs/toolchain@v1 with: # TODO: refactor toolchain version - toolchain: 1.55.0 + toolchain: 1.57.0 components: clippy, rustfmt default: true - name: Install dependencies @@ -49,7 +49,7 @@ jobs: - name: Install Rust uses: actions-rs/toolchain@v1 with: - toolchain: 1.55.0 + toolchain: 1.57.0 components: clippy, rustfmt default: true - name: Build binary @@ -83,7 +83,7 @@ jobs: - name: Install Rust uses: actions-rs/toolchain@v1 with: - toolchain: 1.55.0 + toolchain: 1.57.0 components: clippy, rustfmt default: true - name: Build binary @@ -128,7 +128,7 @@ jobs: uses: actions-rs/toolchain@v1 with: # TODO: refactor toolchain version - toolchain: 1.55.0 + toolchain: 1.57.0 components: clippy, rustfmt default: true - name: Install wasm-pack diff --git a/README.md b/README.md index 9d535c5..6baeb56 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ from [GitHub Actions](https://actions-badge.atrox.dev/iceiix/stevenarella/goto?r ## Dependencies -Requires Rust stable version 1.55.0 or newer. +Requires Rust stable version 1.57.0 or newer. **Debian/Ubuntu** From 669e37ac5cb22e32678c5ac51d7aded90c1f54c4 Mon Sep 17 00:00:00 2001 From: ice_iix Date: Fri, 24 Dec 2021 09:17:58 -0800 Subject: [PATCH 2/5] Suppress dead_code warnings for unused fields new in Rust 1.57 --- protocol/src/types/metadata.rs | 1 + src/model/mod.rs | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/protocol/src/types/metadata.rs b/protocol/src/types/metadata.rs index 4020418..1c8cec9 100644 --- a/protocol/src/types/metadata.rs +++ b/protocol/src/types/metadata.rs @@ -656,6 +656,7 @@ impl Serializable for ParticleData { } #[derive(Debug)] +#[allow(dead_code)] pub struct VillagerData { villager_type: protocol::VarInt, profession: protocol::VarInt, diff --git a/src/model/mod.rs b/src/model/mod.rs index e0a7099..0b2fa02 100644 --- a/src/model/mod.rs +++ b/src/model/mod.rs @@ -880,7 +880,9 @@ struct RawModel { uvlock: bool, weight: f64, + #[allow(dead_code)] display: HashMap>, + #[allow(dead_code)] builtin: BuiltinType, } @@ -899,6 +901,7 @@ impl RawModel { } #[derive(Debug)] +#[allow(dead_code)] struct ModelDisplay { rotation: [f64; 3], translation: [f64; 3], @@ -935,6 +938,7 @@ struct BlockFace { struct Model { faces: Vec, ambient_occlusion: bool, + #[allow(dead_code)] weight: f64, } @@ -945,6 +949,7 @@ struct Face { vertices: Vec, vertices_texture: Vec, indices: usize, + #[allow(dead_code)] shade: bool, tint_index: i32, } From c3edf715efc36730cb41f42cda0d52b7fac54966 Mon Sep 17 00:00:00 2001 From: ice_iix Date: Fri, 24 Dec 2021 09:25:15 -0800 Subject: [PATCH 3/5] Fix clippy needless_borrow and unused_mut --- src/main.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index ce2a175..32770bb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -540,9 +540,9 @@ fn main2() { fn tick_all( window: &winit::window::Window, game: &mut Game, - mut ui_container: &mut ui::Container, + ui_container: &mut ui::Container, last_frame: &mut Instant, - mut resui: &mut resources::ManagerUI, + resui: &mut resources::ManagerUI, last_resource_version: &mut usize, vsync: &mut bool, ) { @@ -558,7 +558,7 @@ fn tick_all( let version = { let try_res = game.resource_manager.try_write(); if let Ok(mut res) = try_res { - res.tick(&mut resui, &mut ui_container, delta); + res.tick(resui, ui_container, delta); res.version() } else { // TODO: why does game.resource_manager.write() sometimes deadlock? @@ -591,7 +591,7 @@ fn tick_all( .tick(&mut game.server.world, &mut game.renderer, version); game.screen_sys - .tick(delta, &mut game.renderer, &mut ui_container); + .tick(delta, &mut game.renderer, ui_container); /* TODO: open console for chat messages if let Some(received_chat_at) = game.server.received_chat_at { if Instant::now().duration_since(received_chat_at).as_secs() < 5 { @@ -603,7 +603,7 @@ fn tick_all( game.console .lock() .unwrap() - .tick(&mut ui_container, &game.renderer, delta, width); + .tick(ui_container, &game.renderer, delta, width); ui_container.tick(&mut game.renderer, delta, width, height); game.renderer.tick( &mut game.server.world, From a90a6af7c26b0c95aab2f66cd85fa35672bae932 Mon Sep 17 00:00:00 2001 From: ice_iix Date: Fri, 24 Dec 2021 09:32:56 -0800 Subject: [PATCH 4/5] Update to Rust 2021 --- Cargo.toml | 2 +- blocks/Cargo.toml | 2 +- protocol/Cargo.toml | 2 +- resources/Cargo.toml | 2 +- shared/Cargo.toml | 2 +- std_or_web/Cargo.toml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 64a72bc..b4525bb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "stevenarella" version = "0.0.1" authors = [ "Thinkofdeath ", "iceiix " ] -edition = "2018" +edition = "2021" resolver = "2" description = "Multi-protocol multi-platform Minecraft-compatible client" repository = "https://github.com/iceiix/stevenarella" diff --git a/blocks/Cargo.toml b/blocks/Cargo.toml index c14dac8..f9f1b4b 100644 --- a/blocks/Cargo.toml +++ b/blocks/Cargo.toml @@ -2,7 +2,7 @@ name = "steven_blocks" version = "0.0.1" authors = [ "Thinkofdeath " ] -edition = "2018" +edition = "2021" [dependencies] lazy_static = "1.4.0" diff --git a/protocol/Cargo.toml b/protocol/Cargo.toml index 83f987c..4eb7e72 100644 --- a/protocol/Cargo.toml +++ b/protocol/Cargo.toml @@ -2,7 +2,7 @@ name = "steven_protocol" version = "0.0.1" authors = [ "Thinkofdeath ", "iceiix " ] -edition = "2018" +edition = "2021" [dependencies] serde = "1.0.129" diff --git a/resources/Cargo.toml b/resources/Cargo.toml index aea6370..2e5ad62 100644 --- a/resources/Cargo.toml +++ b/resources/Cargo.toml @@ -2,5 +2,5 @@ name = "steven_resources" version = "0.1.0" authors = [ "Thinkofdeath " ] -edition = "2018" +edition = "2021" build = "build.rs" diff --git a/shared/Cargo.toml b/shared/Cargo.toml index d79e8ae..2f766df 100644 --- a/shared/Cargo.toml +++ b/shared/Cargo.toml @@ -2,6 +2,6 @@ name = "steven_shared" version = "0.0.1" authors = [ "Thinkofdeath " ] -edition = "2018" +edition = "2021" [dependencies] diff --git a/std_or_web/Cargo.toml b/std_or_web/Cargo.toml index c672204..2f589e1 100644 --- a/std_or_web/Cargo.toml +++ b/std_or_web/Cargo.toml @@ -2,7 +2,7 @@ name = "std_or_web" version = "0.0.1" authors = [ "iceiix " ] -edition = "2018" +edition = "2021" [dependencies] cfg-if = "1.0.0" From 2cec81fd064f92149db4b1d6e7871c898cd205bf Mon Sep 17 00:00:00 2001 From: ice_iix Date: Fri, 24 Dec 2021 09:37:01 -0800 Subject: [PATCH 5/5] Cargo.toml: add minimum supported rust_version --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index b4525bb..28c0711 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,6 +3,7 @@ name = "stevenarella" version = "0.0.1" authors = [ "Thinkofdeath ", "iceiix " ] edition = "2021" +rust_version = "1.57" resolver = "2" description = "Multi-protocol multi-platform Minecraft-compatible client" repository = "https://github.com/iceiix/stevenarella"