Skip to content

Commit 427a92d

Browse files
committed
imports
1 parent c499d15 commit 427a92d

File tree

2 files changed

+22
-1
lines changed
  • crates
    • bevy_mod_scripting_core/src/bindings/function
    • bevy_mod_scripting_functions/src

2 files changed

+22
-1
lines changed

crates/bevy_mod_scripting_core/src/bindings/function/from.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,12 @@ impl<T> DerefMut for Val<T> {
166166
}
167167
}
168168

169+
impl<T> From<T> for Val<T> {
170+
fn from(value: T) -> Self {
171+
Val(value)
172+
}
173+
}
174+
169175
impl<T: FromReflect> FromScript for Val<T> {
170176
type This<'w> = Self;
171177
fn from_script(value: ScriptValue, world: WorldGuard) -> Result<Self, InteropError> {
@@ -246,6 +252,12 @@ impl<T: FromReflect> FromScript for Ref<'_, T> {
246252
}
247253
}
248254

255+
impl<'a, T> From<&'a T> for Ref<'a, T> {
256+
fn from(value: &'a T) -> Self {
257+
Ref(value)
258+
}
259+
}
260+
249261
/// A wrapper around a mutable reference to a value of type `T`.
250262
///
251263
/// This can be used to retrieve a mutable reference out of a [`ScriptValue::Reference`] corresponding to the type `T`.
@@ -269,6 +281,12 @@ impl<T> DerefMut for Mut<'_, T> {
269281
}
270282
}
271283

284+
impl<'a, T> From<&'a mut T> for Mut<'a, T> {
285+
fn from(value: &'a mut T) -> Self {
286+
Mut(value)
287+
}
288+
}
289+
272290
impl<T: FromReflect> FromScript for Mut<'_, T> {
273291
type This<'w> = Mut<'w, T>;
274292

crates/bevy_mod_scripting_functions/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
use ::bevy::prelude::*;
22
#[cfg(feature = "core_functions")]
3-
pub mod bevy;
3+
pub mod bevy_bindings;
44
#[cfg(feature = "core_functions")]
55
pub mod core;
66

77
pub mod namespaced_register;
88

9+
pub use core::*;
10+
pub use namespaced_register::*;
11+
912
pub struct BevyFunctionsPlugin;
1013

1114
impl Plugin for BevyFunctionsPlugin {

0 commit comments

Comments
 (0)