Skip to content

Commit

Permalink
Merge pull request #208 from YarnSpinnerTool/fix-compiler-error-2024
Browse files Browse the repository at this point in the history
  • Loading branch information
janhohenheim authored Jul 4, 2024
2 parents 9103204 + d18968a commit bf1b533
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/bevy_plugin/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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/"
Expand Down
17 changes: 10 additions & 7 deletions crates/bevy_plugin/src/commands/command_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<f32>, mut wait: ResMut<Wait>| {
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<f32>, mut wait: ResMut<Wait>| {
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
}
}
Expand Down

0 comments on commit bf1b533

Please sign in to comment.