Skip to content

Commit f8bfe16

Browse files
committed
Incorporate suggested fixes to #20456
1 parent 5dbf82b commit f8bfe16

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

crates/bevy_reflect/src/func/args/from_arg.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
#![expect(
2-
mismatched_lifetime_syntaxes,
3-
reason = "I can't figure out how to fix this."
4-
)]
51
use crate::func::args::{Arg, ArgError};
62
use crate::{Reflect, TypePath};
73

@@ -33,21 +29,21 @@ pub trait FromArg {
3329
/// Creates an item from an argument.
3430
///
3531
/// The argument must be of the expected type and ownership.
36-
fn from_arg(arg: Arg) -> Result<Self::This<'_>, ArgError>;
32+
fn from_arg(arg: Arg<'_>) -> Result<Self::This<'_>, ArgError>;
3733
}
3834

3935
// Blanket impl.
4036
impl<T: Reflect + TypePath> FromArg for &'static T {
4137
type This<'a> = &'a T;
42-
fn from_arg(arg: Arg) -> Result<Self::This<'_>, ArgError> {
38+
fn from_arg(arg: Arg<'_>) -> Result<Self::This<'_>, ArgError> {
4339
arg.take_ref()
4440
}
4541
}
4642

4743
// Blanket impl.
4844
impl<T: Reflect + TypePath> FromArg for &'static mut T {
4945
type This<'a> = &'a mut T;
50-
fn from_arg(arg: Arg) -> Result<Self::This<'_>, ArgError> {
46+
fn from_arg(arg: Arg<'_>) -> Result<Self::This<'_>, ArgError> {
5147
arg.take_mut()
5248
}
5349
}
@@ -85,7 +81,7 @@ macro_rules! impl_from_arg {
8581
mismatched_lifetime_syntaxes,
8682
reason = "I can't figure out how to fix this."
8783
)]
88-
fn from_arg(arg: $crate::func::args::Arg) ->
84+
fn from_arg(arg: $crate::func::args::Arg<'_>) ->
8985
Result<Self::This<'_>, $crate::func::args::ArgError>
9086
{
9187
arg.take_owned()

crates/bevy_reflect/src/utility.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ mod sealed {
8686
/// # fn try_as_reflect(&self) -> Option<&dyn Reflect> { todo!() }
8787
/// # fn try_as_reflect_mut(&mut self) -> Option<&mut dyn Reflect> { todo!() }
8888
/// # fn try_apply(&mut self, value: &dyn PartialReflect) -> Result<(), ApplyError> { todo!() }
89-
/// # fn reflect_ref(&self) -> ReflectRef <'_> { todo!() }
90-
/// # fn reflect_mut(&mut self) -> ReflectMut <'_> { todo!() }
89+
/// # fn reflect_ref(&self) -> ReflectRef<'_> { todo!() }
90+
/// # fn reflect_mut(&mut self) -> ReflectMut<'_> { todo!() }
9191
/// # fn reflect_owned(self: Box<Self>) -> ReflectOwned { todo!() }
9292
/// # }
9393
/// # impl Reflect for Foo {
@@ -173,8 +173,8 @@ impl<T: TypedProperty> Default for NonGenericTypeCell<T> {
173173
/// # fn try_as_reflect(&self) -> Option<&dyn Reflect> { todo!() }
174174
/// # fn try_as_reflect_mut(&mut self) -> Option<&mut dyn Reflect> { todo!() }
175175
/// # fn try_apply(&mut self, value: &dyn PartialReflect) -> Result<(), ApplyError> { todo!() }
176-
/// # fn reflect_ref(&self) -> ReflectRef <'_> { todo!() }
177-
/// # fn reflect_mut(&mut self) -> ReflectMut <'_> { todo!() }
176+
/// # fn reflect_ref(&self) -> ReflectRef<'_> { todo!() }
177+
/// # fn reflect_mut(&mut self) -> ReflectMut<'_> { todo!() }
178178
/// # fn reflect_owned(self: Box<Self>) -> ReflectOwned { todo!() }
179179
/// # }
180180
/// # impl<T: Reflect + Typed + TypePath> Reflect for Foo<T> {

0 commit comments

Comments
 (0)