Skip to content

Commit d7048fa

Browse files
authored
Rename load_from_path_untyped to load_from_path_erased. (#23441)
# Objective - Rename this method to match up with `load_erased`. - Untyped loads are for loads that don't provide an expected type. That's not the case here! ## Solution - Rename! No migration guide because this was introduced in the 0.19 cycle.
1 parent f987ca6 commit d7048fa

2 files changed

Lines changed: 7 additions & 12 deletions

File tree

crates/bevy_asset/src/reflect.rs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -399,15 +399,12 @@ pub trait LoadFromPath {
399399
/// Initiates the load for the given expected type ID, and the path.
400400
///
401401
/// See [`AssetServer::load_erased`] for more.
402-
fn load_from_path_untyped(
403-
&mut self,
404-
type_id: TypeId,
405-
path: AssetPath<'static>,
406-
) -> UntypedHandle;
402+
fn load_from_path_erased(&mut self, type_id: TypeId, path: AssetPath<'static>)
403+
-> UntypedHandle;
407404
}
408405

409406
impl LoadFromPath for LoadContext<'_> {
410-
fn load_from_path_untyped(
407+
fn load_from_path_erased(
411408
&mut self,
412409
type_id: TypeId,
413410
path: AssetPath<'static>,
@@ -417,7 +414,7 @@ impl LoadFromPath for LoadContext<'_> {
417414
}
418415

419416
impl LoadFromPath for AssetServer {
420-
fn load_from_path_untyped(
417+
fn load_from_path_erased(
421418
&mut self,
422419
type_id: TypeId,
423420
path: AssetPath<'static>,
@@ -462,7 +459,7 @@ impl ReflectDeserializerProcessor for HandleDeserializeProcessor<'_> {
462459
let type_id = asset_type.type_id();
463460
return Ok(Ok(Box::new(match typed_handle_reference.reference {
464461
HandleReference::Path(path) => {
465-
self.load_from_path.load_from_path_untyped(type_id, path)
462+
self.load_from_path.load_from_path_erased(type_id, path)
466463
}
467464
HandleReference::Uuid(uuid) => UntypedHandle::Uuid { type_id, uuid },
468465
})));
@@ -480,9 +477,7 @@ impl ReflectDeserializerProcessor for HandleDeserializeProcessor<'_> {
480477

481478
let type_id = reflect_handle.asset_type_id;
482479
Ok(Ok(reflect_handle.typed(match handle_reference {
483-
HandleReference::Path(path) => {
484-
self.load_from_path.load_from_path_untyped(type_id, path)
485-
}
480+
HandleReference::Path(path) => self.load_from_path.load_from_path_erased(type_id, path),
486481
HandleReference::Uuid(uuid) => UntypedHandle::Uuid { type_id, uuid },
487482
})))
488483
}

crates/bevy_scene/src/serde.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ mod tests {
729729
struct FakeHandleCreator;
730730

731731
impl LoadFromPath for FakeHandleCreator {
732-
fn load_from_path_untyped(
732+
fn load_from_path_erased(
733733
&mut self,
734734
_type_id: TypeId,
735735
_path: AssetPath<'static>,

0 commit comments

Comments
 (0)