diff --git a/crates/bevy_ecs/hecs/src/lib.rs b/crates/bevy_ecs/hecs/src/lib.rs index a76b98c00d..851ba45673 100644 --- a/crates/bevy_ecs/hecs/src/lib.rs +++ b/crates/bevy_ecs/hecs/src/lib.rs @@ -33,7 +33,7 @@ //! let a = world.spawn((123, true, "abc")); //! let b = world.spawn((42, false)); //! // Systems can be simple for loops -//! for (id, number, &flag) in &mut world.query::<(Entity, &mut i32, &bool)>() { +//! for (id, mut number, &flag) in &mut world.query::<(Entity, &mut i32, &bool)>() { //! if flag { *number *= 2; } //! } //! assert_eq!(*world.get::(a).unwrap(), 246); diff --git a/crates/bevy_ecs/hecs/src/world.rs b/crates/bevy_ecs/hecs/src/world.rs index a8af885200..5b59acc493 100644 --- a/crates/bevy_ecs/hecs/src/world.rs +++ b/crates/bevy_ecs/hecs/src/world.rs @@ -272,7 +272,7 @@ impl World { /// let a = world.spawn((123, true, "abc")); /// // The returned query must outlive the borrow made by `get` /// let mut query = world.query_one::<(&mut i32, &bool)>(a).unwrap(); - /// let (number, flag) = query.get().unwrap(); + /// let (mut number, flag) = query.get().unwrap(); /// if *flag { *number *= 2; } /// assert_eq!(*number, 246); /// ``` diff --git a/src/lib.rs b/src/lib.rs index 401386e2a6..e907ac18a4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -8,12 +8,11 @@ //! //! ## Example //!Here is a simple "Hello World" Bevy app: -//! ```no_run +//! ``` //!use bevy::prelude::*; //! //!fn main() { //! App::build() -//! .add_default_plugins() //! .add_system(hello_world_system.system()) //! .run(); //!}