Move default docs (#9638)
# Objective - Make the default docs more useful like suggested in https://github.com/bevyengine/bevy/pull/9600#issuecomment-1696452118 ## 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  ### After 
This commit is contained in:
parent
f2f39c835a
commit
fb094eab87
@ -168,11 +168,11 @@ pub struct Schedule {
|
||||
#[derive(ScheduleLabel, Hash, PartialEq, Eq, Debug, Clone)]
|
||||
struct DefaultSchedule;
|
||||
|
||||
/// Creates a schedule with a default label. Only use in situations where
|
||||
/// where you don't care about the [`ScheduleLabel`]. Inserting a default schedule
|
||||
/// into the world risks overwriting another schedule. For most situations you should use
|
||||
/// [`Schedule::new`].
|
||||
impl Default for Schedule {
|
||||
/// Creates a schedule with a default label. Only use in situations where
|
||||
/// you don't care about the [`ScheduleLabel`]. Inserting a default schedule
|
||||
/// into the world risks overwriting another schedule. For most situations
|
||||
/// you should use [`Schedule::new`].
|
||||
fn default() -> Self {
|
||||
Self::new(DefaultSchedule)
|
||||
}
|
||||
|
||||
@ -38,8 +38,8 @@ impl std::iter::FromIterator<Layer> for RenderLayers {
|
||||
}
|
||||
}
|
||||
|
||||
/// Defaults to containing to layer `0`, the first layer.
|
||||
impl Default for RenderLayers {
|
||||
/// By default, this structure includes layer `0`, which represents the first layer.
|
||||
fn default() -> Self {
|
||||
RenderLayers::layer(0)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user