fix some doc tests

This commit is contained in:
Carter Anderson 2020-07-23 13:40:07 -07:00
parent 70b12452b5
commit 89af5ea4e0
3 changed files with 3 additions and 4 deletions

View file

@ -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::<i32>(a).unwrap(), 246);

View file

@ -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);
/// ```

View file

@ -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();
//!}