Skip to content

Commit fb094ea

Browse files
authored
Move default docs (#9638)
# Objective - Make the default docs more useful like suggested in #9600 (comment) ## Solution - Move the documentation to the `fn default()` method instead of the `impl Default`. Allows you to view the docs directly on the function without having to go to the implementation. ### Before ![Screenshot 2023-08-29 at 18 21 03](https://github.com/bevyengine/bevy/assets/104745335/6d31591e-f190-4b8e-8bc3-a570ada294f0) ### After ![Screenshot 2023-08-29 at 18 19 54](https://github.com/bevyengine/bevy/assets/104745335/e2442ec1-593d-47f3-b539-8c77a170f0b6)
1 parent f2f39c8 commit fb094ea

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

crates/bevy_ecs/src/schedule/schedule.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,11 @@ pub struct Schedule {
168168
#[derive(ScheduleLabel, Hash, PartialEq, Eq, Debug, Clone)]
169169
struct DefaultSchedule;
170170

171-
/// Creates a schedule with a default label. Only use in situations where
172-
/// where you don't care about the [`ScheduleLabel`]. Inserting a default schedule
173-
/// into the world risks overwriting another schedule. For most situations you should use
174-
/// [`Schedule::new`].
175171
impl Default for Schedule {
172+
/// Creates a schedule with a default label. Only use in situations where
173+
/// you don't care about the [`ScheduleLabel`]. Inserting a default schedule
174+
/// into the world risks overwriting another schedule. For most situations
175+
/// you should use [`Schedule::new`].
176176
fn default() -> Self {
177177
Self::new(DefaultSchedule)
178178
}

crates/bevy_render/src/view/visibility/render_layers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ impl std::iter::FromIterator<Layer> for RenderLayers {
3838
}
3939
}
4040

41-
/// Defaults to containing to layer `0`, the first layer.
4241
impl Default for RenderLayers {
42+
/// By default, this structure includes layer `0`, which represents the first layer.
4343
fn default() -> Self {
4444
RenderLayers::layer(0)
4545
}

0 commit comments

Comments
 (0)