Skip to content

Commit c85c1c5

Browse files
committed
more clippy
1 parent 6aab6f0 commit c85c1c5

File tree

3 files changed

+5
-15
lines changed

3 files changed

+5
-15
lines changed

crates/bevy_mod_scripting_core/src/context.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ impl<P: IntoScriptPluginParams> ScriptContexts<P> {
5959

6060
/// Initializer run once after creating a context but before executing it for the first time
6161
pub type ContextInitializer<P> =
62-
fn(&ScriptId, &mut <P as IntoScriptPluginParams>::C) -> Result<(), ScriptError>;
62+
fn(&str, &mut <P as IntoScriptPluginParams>::C) -> Result<(), ScriptError>;
6363
/// Initializer run every time before executing or loading a script
6464
pub type ContextPreHandlingInitializer<P> =
65-
fn(&ScriptId, Entity, &mut <P as IntoScriptPluginParams>::C) -> Result<(), ScriptError>;
65+
fn(&str, Entity, &mut <P as IntoScriptPluginParams>::C) -> Result<(), ScriptError>;
6666

6767
#[derive(Resource)]
6868
pub struct ContextLoadingSettings<P: IntoScriptPluginParams> {

crates/languages/bevy_mod_scripting_lua/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ impl Plugin for LuaScriptingPlugin {
6666
.map_err(ScriptError::from_mlua_error)?;
6767
context
6868
.globals()
69-
.set("script_id", script_id.clone())
69+
.set("script_id", script_id)
7070
.map_err(ScriptError::from_mlua_error)?;
7171
Ok(())
7272
},

crates/languages/bevy_mod_scripting_lua/tests/lua_tests.rs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use bevy::{
77
use bevy_mod_scripting_core::{
88
bindings::{
99
access_map::ReflectAccessId, pretty_print::DisplayWithWorld, script_value::ScriptValue,
10-
ScriptTypeRegistration, WorldAccessGuard,
10+
ReflectReference, ScriptTypeRegistration, WorldAccessGuard,
1111
},
1212
context::ContextLoadingSettings,
1313
error::ScriptError,
@@ -22,7 +22,6 @@ use bevy_mod_scripting_lua::{
2222
};
2323
use libtest_mimic::{Arguments, Failed, Trial};
2424
use std::{
25-
borrow::Cow,
2625
fs::{self, DirEntry},
2726
io, panic,
2827
path::{Path, PathBuf},
@@ -53,7 +52,7 @@ fn init_app() -> App {
5352
app
5453
}
5554

56-
fn init_lua_test_utils(_script_name: &Cow<'static, str>, lua: &mut Lua) -> Result<(), ScriptError> {
55+
fn init_lua_test_utils(_script_name: &str, lua: &mut Lua) -> Result<(), ScriptError> {
5756
let _get_mock_type = lua
5857
.create_function(|l, ()| {
5958
let world = l.get_world();
@@ -92,15 +91,6 @@ fn init_lua_test_utils(_script_name: &Cow<'static, str>, lua: &mut Lua) -> Resul
9291
.create_function(|lua, (f, regex): (LuaFunction, String)| {
9392
let world = lua.get_world();
9493

95-
// let result = match std::panic::catch_unwind(|| ) {
96-
// Ok(e) => e,
97-
// Err(panic) => {
98-
// return Err(mlua::Error::RuntimeError(format!(
99-
// "Function panicked: {:?}",
100-
// panic
101-
// )))
102-
// }
103-
// };
10494
let result = f.call::<()>(());
10595
let err = match result {
10696
Ok(_) => {

0 commit comments

Comments
 (0)