Fix cargo doc warnings (#1640)

Fixes all warnings from `cargo doc --all`.
Those related to code blocks were introduced in #1612, but re-formatting using the experimental features in `rustfmt.toml` doesn't seem to reintroduce them.
This commit is contained in:
davier 2021-03-13 18:23:38 +00:00
parent 75ae20dc4a
commit 8acb0d2012
5 changed files with 15 additions and 7 deletions

View File

@ -13,7 +13,9 @@ use std::{
/// Lightweight unique ID of an entity /// Lightweight unique ID of an entity
/// ///
/// Obtained from [World::spawn](crate::world::World::spawn), typically via [Commands::spawn](crate::system::Commands::spawn). Can be stored to refer to an entity in the future. /// Obtained from [World::spawn](crate::world::World::spawn), typically via
/// [Commands::spawn](crate::system::Commands::spawn). Can be stored to refer to an entity in the
/// future.
/// ///
/// `Entity` can be a part of a query, e.g. `Query<(Entity, &MyComponent)>`. /// `Entity` can be a part of a query, e.g. `Query<(Entity, &MyComponent)>`.
/// Components of a specific entity can be accessed using /// Components of a specific entity can be accessed using

View File

@ -18,7 +18,7 @@ impl SystemId {
/// An ECS system that can be added to a [Schedule](crate::schedule::Schedule) /// An ECS system that can be added to a [Schedule](crate::schedule::Schedule)
/// ///
/// Systems are functions with all arguments implementing [SystemParam]. /// Systems are functions with all arguments implementing [SystemParam](crate::system::SystemParam).
/// ///
/// Systems are added to an application using `AppBuilder::add_system(my_system.system())` /// Systems are added to an application using `AppBuilder::add_system(my_system.system())`
/// or similar methods, and will generally run once per pass of the main loop. /// or similar methods, and will generally run once per pass of the main loop.

View File

@ -351,7 +351,8 @@ impl World {
/// Despawns the given `entity`, if it exists. This will also remove all of the entity's /// Despawns the given `entity`, if it exists. This will also remove all of the entity's
/// [Component]s. Returns `true` if the `entity` is successfully despawned and `false` if /// [Component]s. Returns `true` if the `entity` is successfully despawned and `false` if
/// the `entity` does not exist. ``` /// the `entity` does not exist.
/// ```
/// use bevy_ecs::world::World; /// use bevy_ecs::world::World;
/// ///
/// struct Position { /// struct Position {
@ -366,6 +367,7 @@ impl World {
/// assert!(world.despawn(entity)); /// assert!(world.despawn(entity));
/// assert!(world.get_entity(entity).is_none()); /// assert!(world.get_entity(entity).is_none());
/// assert!(world.get::<Position>(entity).is_none()); /// assert!(world.get::<Position>(entity).is_none());
/// ```
#[inline] #[inline]
pub fn despawn(&mut self, entity: Entity) -> bool { pub fn despawn(&mut self, entity: Entity) -> bool {
self.get_entity_mut(entity) self.get_entity_mut(entity)
@ -596,7 +598,8 @@ impl World {
/// Temporarily removes the requested resource from this [World], then re-adds it before /// Temporarily removes the requested resource from this [World], then re-adds it before
/// returning. This enables safe mutable access to a resource while still providing mutable /// returning. This enables safe mutable access to a resource while still providing mutable
/// world access ``` /// world access
/// ```
/// use bevy_ecs::world::{World, Mut}; /// use bevy_ecs::world::{World, Mut};
/// struct A(u32); /// struct A(u32);
/// struct B(u32); /// struct B(u32);

View File

@ -58,7 +58,7 @@ pub enum StorageTextureAccess {
/// ``` /// ```
WriteOnly, WriteOnly,
/// The texture can be both read and written in the shader. /// The texture can be both read and written in the shader.
/// [`Features::STORAGE_TEXTURE_ACCESS_READ_WRITE`] must be enabled to use this access mode. /// `wgpu::Features::STORAGE_TEXTURE_ACCESS_READ_WRITE` must be enabled to use this access mode.
/// ///
/// Example GLSL syntax: /// Example GLSL syntax:
/// ```cpp,ignore /// ```cpp,ignore

View File

@ -6,8 +6,11 @@ use rand::{rngs::StdRng, Rng, SeedableRng};
/// This example spawns a large number of cubes, each with its own changing position and material /// This example spawns a large number of cubes, each with its own changing position and material
/// This is intended to be a stress test of bevy's ability to render many objects with different /// This is intended to be a stress test of bevy's ability to render many objects with different
/// properties For the best results, run it in release mode: ```cargo run --example spawner /// properties For the best results, run it in release mode:
/// --release NOTE: Bevy still has a number of optimizations to do in this area. Expect the /// ```
/// cargo run --example spawner --release
/// ```
/// NOTE: Bevy still has a number of optimizations to do in this area. Expect the
/// performance here to go way up in the future /// performance here to go way up in the future
fn main() { fn main() {
App::build() App::build()