Skip to content

Commit 6edfe1d

Browse files
authored
Link ComponentIdFor in the ComponentId related docs (#20127)
# Objective Fixes #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`
1 parent b807286 commit 6edfe1d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

crates/bevy_ecs/src/component/info.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,7 @@ impl Components {
641641
///
642642
/// # See also
643643
///
644+
/// * [`ComponentIdFor`](super::ComponentIdFor)
644645
/// * [`Components::get_id()`]
645646
/// * [`Components::resource_id()`]
646647
/// * [`World::component_id()`](crate::world::World::component_id)

crates/bevy_ecs/src/world/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,7 @@ impl World {
602602
///
603603
/// # See also
604604
///
605+
/// * [`ComponentIdFor`](crate::component::ComponentIdFor)
605606
/// * [`Components::component_id()`]
606607
/// * [`Components::get_id()`]
607608
#[inline]
@@ -704,7 +705,7 @@ impl World {
704705
/// }
705706
/// ```
706707
///
707-
/// ## [`EntityHashSet`](crate::entity::EntityHashMap)
708+
/// ## [`EntityHashSet`](crate::entity::EntityHashSet)
708709
///
709710
/// ```
710711
/// # use bevy_ecs::{prelude::*, entity::EntityHashSet};
@@ -838,7 +839,7 @@ impl World {
838839
/// }
839840
/// ```
840841
///
841-
/// ## [`EntityHashSet`](crate::entity::EntityHashMap)
842+
/// ## [`EntityHashSet`](crate::entity::EntityHashSet)
842843
///
843844
/// ```
844845
/// # use bevy_ecs::{prelude::*, entity::EntityHashSet};

0 commit comments

Comments
 (0)