Link ComponentIdFor in the ComponentId related docs (#20127)

# Objective

Fixes https://github.com/bevyengine/bevy/issues/19535. Improve
interoperability of type documentation to make it easier for users to
find related types

## Solution

- Add a reference to
[`ComponentIdFor`](crate::component::ComponentIdFor) in the
`component_id` function documentation in
`crates/bevy_ecs/src/world/mod.rs`
- Add a reference to [`ComponentIdFor`](super::ComponentIdFor) in the
`component_id` function documentation in
`crates/bevy_ecs/src/component/info.rs`

## Testing

- Verify documentation generation: `cargo doc`
- Check the validity of cross-reference links in the documentation
- Confirm that the documentation generated by rustdoc can correctly jump
to the type definition of `ComponentIdFor`
This commit is contained in:
Sieluna 2025-07-15 00:59:08 +03:00 committed by GitHub
parent b8072864aa
commit 6edfe1d39b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -641,6 +641,7 @@ impl Components {
///
/// # See also
///
/// * [`ComponentIdFor`](super::ComponentIdFor)
/// * [`Components::get_id()`]
/// * [`Components::resource_id()`]
/// * [`World::component_id()`](crate::world::World::component_id)

View File

@ -602,6 +602,7 @@ impl World {
///
/// # See also
///
/// * [`ComponentIdFor`](crate::component::ComponentIdFor)
/// * [`Components::component_id()`]
/// * [`Components::get_id()`]
#[inline]
@ -704,7 +705,7 @@ impl World {
/// }
/// ```
///
/// ## [`EntityHashSet`](crate::entity::EntityHashMap)
/// ## [`EntityHashSet`](crate::entity::EntityHashSet)
///
/// ```
/// # use bevy_ecs::{prelude::*, entity::EntityHashSet};
@ -838,7 +839,7 @@ impl World {
/// }
/// ```
///
/// ## [`EntityHashSet`](crate::entity::EntityHashMap)
/// ## [`EntityHashSet`](crate::entity::EntityHashSet)
///
/// ```
/// # use bevy_ecs::{prelude::*, entity::EntityHashSet};