Merge pull request #639 from iceiix/rust2021

Update to Rust 1.57.0 and 2021 edition
This commit is contained in:
iceiix 2021-12-24 10:53:27 -08:00 committed by GitHub
commit 21a1b64a14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 23 additions and 16 deletions

View File

@ -11,7 +11,7 @@ jobs:
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
# TODO: refactor toolchain version # TODO: refactor toolchain version
toolchain: 1.55.0 toolchain: 1.57.0
components: clippy, rustfmt components: clippy, rustfmt
default: true default: true
- name: Install dependencies - name: Install dependencies
@ -49,7 +49,7 @@ jobs:
- name: Install Rust - name: Install Rust
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
toolchain: 1.55.0 toolchain: 1.57.0
components: clippy, rustfmt components: clippy, rustfmt
default: true default: true
- name: Build binary - name: Build binary
@ -83,7 +83,7 @@ jobs:
- name: Install Rust - name: Install Rust
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
toolchain: 1.55.0 toolchain: 1.57.0
components: clippy, rustfmt components: clippy, rustfmt
default: true default: true
- name: Build binary - name: Build binary
@ -128,7 +128,7 @@ jobs:
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
# TODO: refactor toolchain version # TODO: refactor toolchain version
toolchain: 1.55.0 toolchain: 1.57.0
components: clippy, rustfmt components: clippy, rustfmt
default: true default: true
- name: Install wasm-pack - name: Install wasm-pack

View File

@ -2,7 +2,8 @@
name = "stevenarella" name = "stevenarella"
version = "0.0.1" version = "0.0.1"
authors = [ "Thinkofdeath <thinkofdeath@spigotmc.org>", "iceiix <ice_ix@protonmail.ch>" ] authors = [ "Thinkofdeath <thinkofdeath@spigotmc.org>", "iceiix <ice_ix@protonmail.ch>" ]
edition = "2018" edition = "2021"
rust_version = "1.57"
resolver = "2" resolver = "2"
description = "Multi-protocol multi-platform Minecraft-compatible client" description = "Multi-protocol multi-platform Minecraft-compatible client"
repository = "https://github.com/iceiix/stevenarella" repository = "https://github.com/iceiix/stevenarella"

View File

@ -68,7 +68,7 @@ from [GitHub Actions](https://actions-badge.atrox.dev/iceiix/stevenarella/goto?r
## Dependencies ## Dependencies
Requires Rust stable version 1.55.0 or newer. Requires Rust stable version 1.57.0 or newer.
**Debian/Ubuntu** **Debian/Ubuntu**

View File

@ -2,7 +2,7 @@
name = "steven_blocks" name = "steven_blocks"
version = "0.0.1" version = "0.0.1"
authors = [ "Thinkofdeath <thinkofdeath@spigotmc.org>" ] authors = [ "Thinkofdeath <thinkofdeath@spigotmc.org>" ]
edition = "2018" edition = "2021"
[dependencies] [dependencies]
lazy_static = "1.4.0" lazy_static = "1.4.0"

View File

@ -2,7 +2,7 @@
name = "steven_protocol" name = "steven_protocol"
version = "0.0.1" version = "0.0.1"
authors = [ "Thinkofdeath <thinkofdeath@spigotmc.org>", "iceiix <ice_ix@protonmail.ch>" ] authors = [ "Thinkofdeath <thinkofdeath@spigotmc.org>", "iceiix <ice_ix@protonmail.ch>" ]
edition = "2018" edition = "2021"
[dependencies] [dependencies]
serde = "1.0.132" serde = "1.0.132"

View File

@ -656,6 +656,7 @@ impl Serializable for ParticleData {
} }
#[derive(Debug)] #[derive(Debug)]
#[allow(dead_code)]
pub struct VillagerData { pub struct VillagerData {
villager_type: protocol::VarInt, villager_type: protocol::VarInt,
profession: protocol::VarInt, profession: protocol::VarInt,

View File

@ -2,5 +2,5 @@
name = "steven_resources" name = "steven_resources"
version = "0.1.0" version = "0.1.0"
authors = [ "Thinkofdeath <thinkofdeath@spigotmc.org>" ] authors = [ "Thinkofdeath <thinkofdeath@spigotmc.org>" ]
edition = "2018" edition = "2021"
build = "build.rs" build = "build.rs"

View File

@ -2,6 +2,6 @@
name = "steven_shared" name = "steven_shared"
version = "0.0.1" version = "0.0.1"
authors = [ "Thinkofdeath <thinkofdeath@spigotmc.org>" ] authors = [ "Thinkofdeath <thinkofdeath@spigotmc.org>" ]
edition = "2018" edition = "2021"
[dependencies] [dependencies]

View File

@ -540,9 +540,9 @@ fn main2() {
fn tick_all( fn tick_all(
window: &winit::window::Window, window: &winit::window::Window,
game: &mut Game, game: &mut Game,
mut ui_container: &mut ui::Container, ui_container: &mut ui::Container,
last_frame: &mut Instant, last_frame: &mut Instant,
mut resui: &mut resources::ManagerUI, resui: &mut resources::ManagerUI,
last_resource_version: &mut usize, last_resource_version: &mut usize,
vsync: &mut bool, vsync: &mut bool,
) { ) {
@ -558,7 +558,7 @@ fn tick_all(
let version = { let version = {
let try_res = game.resource_manager.try_write(); let try_res = game.resource_manager.try_write();
if let Ok(mut res) = try_res { if let Ok(mut res) = try_res {
res.tick(&mut resui, &mut ui_container, delta); res.tick(resui, ui_container, delta);
res.version() res.version()
} else { } else {
// TODO: why does game.resource_manager.write() sometimes deadlock? // 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); .tick(&mut game.server.world, &mut game.renderer, version);
game.screen_sys game.screen_sys
.tick(delta, &mut game.renderer, &mut ui_container); .tick(delta, &mut game.renderer, ui_container);
/* TODO: open console for chat messages /* TODO: open console for chat messages
if let Some(received_chat_at) = game.server.received_chat_at { if let Some(received_chat_at) = game.server.received_chat_at {
if Instant::now().duration_since(received_chat_at).as_secs() < 5 { if Instant::now().duration_since(received_chat_at).as_secs() < 5 {
@ -603,7 +603,7 @@ fn tick_all(
game.console game.console
.lock() .lock()
.unwrap() .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); ui_container.tick(&mut game.renderer, delta, width, height);
game.renderer.tick( game.renderer.tick(
&mut game.server.world, &mut game.server.world,

View File

@ -880,7 +880,9 @@ struct RawModel {
uvlock: bool, uvlock: bool,
weight: f64, weight: f64,
#[allow(dead_code)]
display: HashMap<String, ModelDisplay, BuildHasherDefault<FNVHash>>, display: HashMap<String, ModelDisplay, BuildHasherDefault<FNVHash>>,
#[allow(dead_code)]
builtin: BuiltinType, builtin: BuiltinType,
} }
@ -899,6 +901,7 @@ impl RawModel {
} }
#[derive(Debug)] #[derive(Debug)]
#[allow(dead_code)]
struct ModelDisplay { struct ModelDisplay {
rotation: [f64; 3], rotation: [f64; 3],
translation: [f64; 3], translation: [f64; 3],
@ -935,6 +938,7 @@ struct BlockFace {
struct Model { struct Model {
faces: Vec<Face>, faces: Vec<Face>,
ambient_occlusion: bool, ambient_occlusion: bool,
#[allow(dead_code)]
weight: f64, weight: f64,
} }
@ -945,6 +949,7 @@ struct Face {
vertices: Vec<BlockVertex>, vertices: Vec<BlockVertex>,
vertices_texture: Vec<render::Texture>, vertices_texture: Vec<render::Texture>,
indices: usize, indices: usize,
#[allow(dead_code)]
shade: bool, shade: bool,
tint_index: i32, tint_index: i32,
} }

View File

@ -2,7 +2,7 @@
name = "std_or_web" name = "std_or_web"
version = "0.0.1" version = "0.0.1"
authors = [ "iceiix <ice_ix@protonmail.ch>" ] authors = [ "iceiix <ice_ix@protonmail.ch>" ]
edition = "2018" edition = "2021"
[dependencies] [dependencies]
cfg-if = "1.0.0" cfg-if = "1.0.0"