Skip to content

Commit 3a32a21

Browse files
authored
Fix clippy stuff (#1433)
* Fix clippy stuff * Add comments explaining inconsistency Also explains that the code is unused
1 parent 7be096a commit 3a32a21

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

crates/bevy_reflect/src/impls/bevy_ecs.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ impl<Scene: Component + IntoComponent<Runtime>, Runtime: Component> FromType<Sce
149149
scene_entity,
150150
runtime_entity| {
151151
let scene_component = scene_world.get::<Scene>(scene_entity).unwrap();
152-
let destination_component = scene_component.into_component(resources);
152+
let destination_component = scene_component.as_component(resources);
153153
runtime_world
154154
.insert_one(runtime_entity, destination_component)
155155
.unwrap();
@@ -195,7 +195,7 @@ impl<Runtime: Component + IntoComponent<Scene>, Scene: Component> FromType<Runti
195195
runtime_entity,
196196
scene_entity| {
197197
let runtime_component = runtime_world.get::<Runtime>(runtime_entity).unwrap();
198-
let scene_component = runtime_component.into_component(resources);
198+
let scene_component = runtime_component.as_component(resources);
199199
scene_world
200200
.insert_one(scene_entity, scene_component)
201201
.unwrap();
@@ -236,6 +236,10 @@ impl<C: Component + MapEntities> FromType<C> for ReflectMapEntities {
236236
}
237237
}
238238

239+
// TODO: Dead code - this trait is never implemented
240+
// The name of the method was changed in <https://github.com/bevyengine/bevy/pull/1433>
241+
// to fix the update to clippy for Rust 1.50
242+
// which is why this is inconsistent
239243
pub trait IntoComponent<ToComponent: Component> {
240-
fn into_component(&self, resources: &Resources) -> ToComponent;
244+
fn as_component(&self, resources: &Resources) -> ToComponent;
241245
}

crates/bevy_reflect/src/type_registry.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@ where
218218
}
219219
}
220220

221+
// TODO: Dead code
222+
// This trait seems to be unused apart from in implementations of this trait
221223
pub trait FromType<T> {
222224
fn from_type() -> Self;
223225
}

0 commit comments

Comments
 (0)