From 1fd6ccdb2baffc58314ca57c8e2f47b6d122ecee Mon Sep 17 00:00:00 2001 From: Jan Hohenheim Date: Thu, 4 Jul 2024 20:06:40 +0200 Subject: [PATCH 1/2] Fix compiler error for 2024 edition --- Cargo.lock | 2 +- crates/bevy_plugin/Cargo.toml | 2 +- crates/bevy_plugin/src/commands/command_registry.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 51a4af1f..9f2e78a2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1176,7 +1176,7 @@ dependencies = [ [[package]] name = "bevy_yarnspinner" -version = "0.3.0" +version = "0.3.1" dependencies = [ "anyhow", "bevy", diff --git a/crates/bevy_plugin/Cargo.toml b/crates/bevy_plugin/Cargo.toml index 61815b9a..2f6291b1 100644 --- a/crates/bevy_plugin/Cargo.toml +++ b/crates/bevy_plugin/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bevy_yarnspinner" -version = "0.3.0" +version = "0.3.1" edition = "2021" repository = "https://github.com/YarnSpinnerTool/YarnSpinner-Rust" homepage = "https://docs.yarnspinner.dev/" diff --git a/crates/bevy_plugin/src/commands/command_registry.rs b/crates/bevy_plugin/src/commands/command_registry.rs index bfa39af6..89ef14df 100644 --- a/crates/bevy_plugin/src/commands/command_registry.rs +++ b/crates/bevy_plugin/src/commands/command_registry.rs @@ -114,8 +114,8 @@ impl YarnCommands { .add_command("wait", |In(duration): In, mut wait: ResMut| { wait.add(Duration::from_secs_f32(duration)) }) - .add_command("stop", |_: In<()>| { - unreachable!("The stop command is a compiler builtin and is thus not callable") + .add_command("stop", |_: In<()>| -> () { + unreachable!("The stop command is a compiler builtin and is thus not callable"); }); commands } From d18968ad964e18c9fcf4e14a82751e88826b92c0 Mon Sep 17 00:00:00 2001 From: Jan Hohenheim Date: Thu, 4 Jul 2024 20:13:40 +0200 Subject: [PATCH 2/2] Add clippy allow --- .../src/commands/command_registry.rs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/crates/bevy_plugin/src/commands/command_registry.rs b/crates/bevy_plugin/src/commands/command_registry.rs index 89ef14df..b2104cbb 100644 --- a/crates/bevy_plugin/src/commands/command_registry.rs +++ b/crates/bevy_plugin/src/commands/command_registry.rs @@ -110,13 +110,16 @@ impl YarnCommands { /// - `wait`: Waits for the given amount of seconds before continuing the dialogue. Note that this does not block and that Bevy will continue updating as normal in the meantime. pub fn builtin_commands() -> Self { let mut commands = Self::default(); - commands - .add_command("wait", |In(duration): In, mut wait: ResMut| { - wait.add(Duration::from_secs_f32(duration)) - }) - .add_command("stop", |_: In<()>| -> () { - unreachable!("The stop command is a compiler builtin and is thus not callable"); - }); + + commands.add_command("wait", |In(duration): In, mut wait: ResMut| { + wait.add(Duration::from_secs_f32(duration)) + }); + + #[allow(clippy::unused_unit)] // Needed for 2024 edition + commands.add_command("stop", |_: In<()>| -> () { + unreachable!("The stop command is a compiler builtin and is thus not callable"); + }); + commands } }