Skip to content

Commit

Permalink
Fixing some doc comments (#9646)
Browse files Browse the repository at this point in the history
# Objective
I've been collecting some mistakes in the documentation and fixed them

---------

Co-authored-by: Emi <emanuel.boehm@gmail.com>
Co-authored-by: Nicola Papale <nicopap@users.noreply.github.com>
  • Loading branch information
3 people authored Aug 31, 2023
1 parent 11567b3 commit 3527288
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 17 deletions.
8 changes: 4 additions & 4 deletions crates/bevy_animation/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,8 @@ pub struct AnimationPlayer {
}

impl AnimationPlayer {
/// Start playing an animation, resetting state of the player
/// This will use a linear blending between the previous and the new animation to make a smooth transition
/// Start playing an animation, resetting state of the player.
/// This will use a linear blending between the previous and the new animation to make a smooth transition.
pub fn start(&mut self, handle: Handle<AnimationClip>) -> &mut Self {
self.animation = PlayingAnimation {
animation_clip: handle,
Expand All @@ -256,8 +256,8 @@ impl AnimationPlayer {
self
}

/// Start playing an animation, resetting state of the player
/// This will use a linear blending between the previous and the new animation to make a smooth transition
/// Start playing an animation, resetting state of the player.
/// This will use a linear blending between the previous and the new animation to make a smooth transition.
pub fn start_with_transition(
&mut self,
handle: Handle<AnimationClip>,
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_asset/src/assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ impl<T: Asset> Assets<T> {
/// Get mutable access to the asset for the given handle.
///
/// This is the main method for mutably accessing asset data from an [Assets] collection. If you
/// do not need mutable access to the asset, you may also use [get](Assets::get).
/// do not need mutable access to the asset, you may also use [`get`](Assets::get).
pub fn get_mut(&mut self, handle: &Handle<T>) -> Option<&mut T> {
let id: HandleId = handle.into();
self.events.send(AssetEvent::Modified {
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_audio/src/audio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl VolumeLevel {
}
}

/// How should Bevy manage the sound playback?
/// The way Bevy manages the sound playback.
#[derive(Debug, Clone, Copy)]
pub enum PlaybackMode {
/// Play the sound once. Do nothing when it ends.
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_audio/src/audio_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl AssetLoader for AudioLoader {
/// in order to be registered.
/// Types that implement this trait usually contain raw sound data that can be converted into an iterator of samples.
/// This trait is implemented for [`AudioSource`].
/// Check the example `audio/decodable` for how to implement this trait on a custom type.
/// Check the example [`decodable`](https://github.com/bevyengine/bevy/blob/latest/examples/audio/decodable.rs) for how to implement this trait on a custom type.
pub trait Decodable: Send + Sync + 'static {
/// The type of the audio samples.
/// Usually a [`u16`], [`i16`] or [`f32`], as those implement [`rodio::Sample`].
Expand Down
11 changes: 4 additions & 7 deletions crates/bevy_transform/src/commands.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
//! Extension to [`EntityCommands`] to modify [`bevy_hierarchy`] hierarchies
//! Extension to [`EntityCommands`] to modify `bevy_hierarchy` hierarchies
//! while preserving [`GlobalTransform`].
use bevy_ecs::{prelude::Entity, system::Command, system::EntityCommands, world::World};
use bevy_hierarchy::{AddChild, RemoveParent};

#[cfg(doc)]
use bevy_hierarchy::BuildChildren;

use crate::{GlobalTransform, Transform};

/// Command similar to [`AddChild`], but updating the child transform to keep
Expand Down Expand Up @@ -63,13 +60,13 @@ impl Command for RemoveParentInPlace {
update_transform();
}
}
/// Collection of methods similar to [`BuildChildren`], but preserving each
/// Collection of methods similar to [`BuildChildren`](bevy_hierarchy::BuildChildren), but preserving each
/// entity's [`GlobalTransform`].
pub trait BuildChildrenTransformExt {
/// Change this entity's parent while preserving this entity's [`GlobalTransform`]
/// by updating its [`Transform`].
///
/// See [`BuildChildren::set_parent`] for a method that doesn't update the
/// See [`BuildChildren::set_parent`](bevy_hierarchy::BuildChildren::set_parent) for a method that doesn't update the
/// [`Transform`].
///
/// Note that both the hierarchy and transform updates will only execute
Expand All @@ -80,7 +77,7 @@ pub trait BuildChildrenTransformExt {
/// Make this entity parentless while preserving this entity's [`GlobalTransform`]
/// by updating its [`Transform`] to be equal to its current [`GlobalTransform`].
///
/// See [`BuildChildren::remove_parent`] for a method that doesn't update the
/// See [`BuildChildren::remove_parent`](bevy_hierarchy::BuildChildren::remove_parent) for a method that doesn't update the
/// [`Transform`].
///
/// Note that both the hierarchy and transform updates will only execute
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_winit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ use crate::web_resize::{CanvasParentResizeEventChannel, CanvasParentResizePlugin
#[cfg(target_os = "android")]
pub static ANDROID_APP: std::sync::OnceLock<AndroidApp> = std::sync::OnceLock::new();

/// A [`Plugin`] that uses [`winit`] to create and manage windows, and receive window and input
/// A [`Plugin`] that uses `winit` to create and manage windows, and receive window and input
/// events.
///
/// This plugin will add systems and resources that sync with the [`winit`] backend and also
/// This plugin will add systems and resources that sync with the `winit` backend and also
/// replace the exising [`App`] runner with one that constructs an [event loop](EventLoop) to
/// receive window and input events from the OS.
#[derive(Default)]
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_winit/src/winit_windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use crate::{
converters::{convert_enabled_buttons, convert_window_level, convert_window_theme},
};

/// A resource mapping window entities to their [`winit`]-backend [`Window`](winit::window::Window)
/// A resource mapping window entities to their `winit`-backend [`Window`](winit::window::Window)
/// states.
#[derive(Debug, Default)]
pub struct WinitWindows {
Expand Down

0 comments on commit 3527288

Please sign in to comment.