Fix LoadContext docs. (#19610)

"add_labeled_asset" (add `Asset`) should be "add_loaded_labeled_asset"
(add `LoadedAsset`).
This commit is contained in:
Al M. 2025-06-12 20:48:55 -07:00 committed by GitHub
parent fa449e6267
commit ef71186d44
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -344,7 +344,7 @@ impl<'a> LoadContext<'a> {
/// Begins a new labeled asset load. Use the returned [`LoadContext`] to load /// 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. /// 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. /// context.
/// Prefer [`LoadContext::labeled_asset_scope`] when possible, which will automatically add /// Prefer [`LoadContext::labeled_asset_scope`] when possible, which will automatically add
/// the labeled [`LoadContext`] back to the parent context. /// the labeled [`LoadContext`] back to the parent context.
@ -360,7 +360,7 @@ impl<'a> LoadContext<'a> {
/// # let load_context: LoadContext = panic!(); /// # let load_context: LoadContext = panic!();
/// let mut handles = Vec::new(); /// let mut handles = Vec::new();
/// for i in 0..2 { /// 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 || { /// handles.push(std::thread::spawn(move || {
/// (i.to_string(), labeled.finish(Image::default())) /// (i.to_string(), labeled.finish(Image::default()))
/// })); /// }));
@ -385,7 +385,7 @@ impl<'a> LoadContext<'a> {
/// [`LoadedAsset`], which is registered under the `label` label. /// [`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 /// 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. /// See [`AssetPath`] for more on labeled assets.
pub fn labeled_asset_scope<A: Asset, E>( pub fn labeled_asset_scope<A: Asset, E>(