From ef71186d44e53867ac760d8054b2073f44584539 Mon Sep 17 00:00:00 2001 From: "Al M." Date: Thu, 12 Jun 2025 20:48:55 -0700 Subject: [PATCH] Fix `LoadContext` docs. (#19610) "add_labeled_asset" (add `Asset`) should be "add_loaded_labeled_asset" (add `LoadedAsset`). --- crates/bevy_asset/src/loader.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/bevy_asset/src/loader.rs b/crates/bevy_asset/src/loader.rs index 50bbfb5dfc..24405f0657 100644 --- a/crates/bevy_asset/src/loader.rs +++ b/crates/bevy_asset/src/loader.rs @@ -344,7 +344,7 @@ impl<'a> LoadContext<'a> { /// Begins a new labeled asset load. Use the returned [`LoadContext`] to load /// dependencies for the new asset and call [`LoadContext::finish`] to finalize the asset load. - /// When finished, make sure you call [`LoadContext::add_labeled_asset`] to add the results back to the parent + /// When finished, make sure you call [`LoadContext::add_loaded_labeled_asset`] to add the results back to the parent /// context. /// Prefer [`LoadContext::labeled_asset_scope`] when possible, which will automatically add /// the labeled [`LoadContext`] back to the parent context. @@ -360,7 +360,7 @@ impl<'a> LoadContext<'a> { /// # let load_context: LoadContext = panic!(); /// let mut handles = Vec::new(); /// for i in 0..2 { - /// let mut labeled = load_context.begin_labeled_asset(); + /// let labeled = load_context.begin_labeled_asset(); /// handles.push(std::thread::spawn(move || { /// (i.to_string(), labeled.finish(Image::default())) /// })); @@ -385,7 +385,7 @@ impl<'a> LoadContext<'a> { /// [`LoadedAsset`], which is registered under the `label` label. /// /// This exists to remove the need to manually call [`LoadContext::begin_labeled_asset`] and then manually register the - /// result with [`LoadContext::add_labeled_asset`]. + /// result with [`LoadContext::add_loaded_labeled_asset`]. /// /// See [`AssetPath`] for more on labeled assets. pub fn labeled_asset_scope(