Skip to content

Commit 8467283

Browse files
committed
give methods on SystemInput clearer names
1 parent 769c9b8 commit 8467283

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

crates/bevy_ecs/src/system/exclusive_function_system.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ macro_rules! impl_exclusive_system_function {
267267
world: &mut World,
268268
$($param: $param,)*
269269
) -> Out {
270-
f(In::into_param(input), world, $($param,)*)
270+
f(In::wrap(input), world, $($param,)*)
271271
}
272272
let ($($param,)*) = param_value;
273273
call_inner(self, input, world, $($param),*)

crates/bevy_ecs/src/system/function_system.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,7 @@ macro_rules! impl_system_function {
841841
input: In::Inner<'_>,
842842
$($param: $param,)*
843843
)->Out{
844-
f(In::into_param(input), $($param,)*)
844+
f(In::wrap(input), $($param,)*)
845845
}
846846
let ($($param,)*) = param_value;
847847
call_inner(self, input, $($param),*)

crates/bevy_ecs/src/system/input.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ pub trait SystemInput: Sized {
2525
type Inner<'i>;
2626

2727
/// Converts a [`SystemInput::Param`] into a [`SystemInput::Inner`].
28-
fn into_inner(this: Self::Param<'_>) -> Self::Inner<'_>;
28+
fn unwrap(this: Self::Param<'_>) -> Self::Inner<'_>;
2929

3030
/// Converts a [`SystemInput::Inner`] into a [`SystemInput::Param`].
31-
fn into_param(this: Self::Inner<'_>) -> Self::Param<'_>;
31+
fn wrap(this: Self::Inner<'_>) -> Self::Param<'_>;
3232
}
3333

3434
/// Shorthand way to get the [`System::In`] for a [`System`] as a [`SystemInput::Inner`].
@@ -39,9 +39,9 @@ impl SystemInput for () {
3939
type Param<'i> = ();
4040
type Inner<'i> = ();
4141

42-
fn into_inner(_this: Self::Param<'_>) -> Self::Inner<'_> {}
42+
fn unwrap(_this: Self::Param<'_>) -> Self::Inner<'_> {}
4343

44-
fn into_param(_this: Self::Inner<'_>) -> Self::Param<'_> {}
44+
fn wrap(_this: Self::Inner<'_>) -> Self::Param<'_> {}
4545
}
4646

4747
/// Wrapper type to mark a [`SystemParam`] as an input.
@@ -78,11 +78,11 @@ impl<T: 'static> SystemInput for In<T> {
7878
type Param<'i> = In<T>;
7979
type Inner<'i> = T;
8080

81-
fn into_inner(this: Self::Param<'_>) -> Self::Inner<'_> {
81+
fn unwrap(this: Self::Param<'_>) -> Self::Inner<'_> {
8282
this.0
8383
}
8484

85-
fn into_param(this: Self::Inner<'_>) -> Self::Param<'_> {
85+
fn wrap(this: Self::Inner<'_>) -> Self::Param<'_> {
8686
In(this)
8787
}
8888
}
@@ -138,11 +138,11 @@ impl<T: ?Sized + 'static> SystemInput for InRef<'_, T> {
138138
type Param<'i> = InRef<'i, T>;
139139
type Inner<'i> = &'i T;
140140

141-
fn into_inner(this: Self::Param<'_>) -> Self::Inner<'_> {
141+
fn unwrap(this: Self::Param<'_>) -> Self::Inner<'_> {
142142
this.0
143143
}
144144

145-
fn into_param(this: Self::Inner<'_>) -> Self::Param<'_> {
145+
fn wrap(this: Self::Inner<'_>) -> Self::Param<'_> {
146146
InRef(this)
147147
}
148148
}
@@ -188,11 +188,11 @@ impl<T: ?Sized + 'static> SystemInput for InMut<'_, T> {
188188
type Param<'i> = InMut<'i, T>;
189189
type Inner<'i> = &'i mut T;
190190

191-
fn into_inner(this: Self::Param<'_>) -> Self::Inner<'_> {
191+
fn unwrap(this: Self::Param<'_>) -> Self::Inner<'_> {
192192
this.0
193193
}
194194

195-
fn into_param(this: Self::Inner<'_>) -> Self::Param<'_> {
195+
fn wrap(this: Self::Inner<'_>) -> Self::Param<'_> {
196196
InMut(this)
197197
}
198198
}
@@ -218,11 +218,11 @@ impl<E: 'static, B: Bundle> SystemInput for Trigger<'_, E, B> {
218218
type Param<'i> = Trigger<'i, E, B>;
219219
type Inner<'i> = Trigger<'i, E, B>;
220220

221-
fn into_inner(this: Self::Param<'_>) -> Self::Inner<'_> {
221+
fn unwrap(this: Self::Param<'_>) -> Self::Inner<'_> {
222222
this
223223
}
224224

225-
fn into_param(this: Self::Inner<'_>) -> Self::Param<'_> {
225+
fn wrap(this: Self::Inner<'_>) -> Self::Param<'_> {
226226
this
227227
}
228228
}
@@ -241,11 +241,11 @@ impl<'a, I: SystemInput> SystemInput for StaticSystemInput<'a, I> {
241241
type Param<'i> = StaticSystemInput<'i, I>;
242242
type Inner<'i> = I::Inner<'i>;
243243

244-
fn into_inner(this: Self::Param<'_>) -> Self::Inner<'_> {
244+
fn unwrap(this: Self::Param<'_>) -> Self::Inner<'_> {
245245
this.0
246246
}
247247

248-
fn into_param(this: Self::Inner<'_>) -> Self::Param<'_> {
248+
fn wrap(this: Self::Inner<'_>) -> Self::Param<'_> {
249249
StaticSystemInput(this)
250250
}
251251
}

0 commit comments

Comments
 (0)