fix some doc tests
This commit is contained in:
parent
70b12452b5
commit
89af5ea4e0
@ -33,7 +33,7 @@
|
|||||||
//! let a = world.spawn((123, true, "abc"));
|
//! let a = world.spawn((123, true, "abc"));
|
||||||
//! let b = world.spawn((42, false));
|
//! let b = world.spawn((42, false));
|
||||||
//! // Systems can be simple for loops
|
//! // 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; }
|
//! if flag { *number *= 2; }
|
||||||
//! }
|
//! }
|
||||||
//! assert_eq!(*world.get::<i32>(a).unwrap(), 246);
|
//! assert_eq!(*world.get::<i32>(a).unwrap(), 246);
|
||||||
|
|||||||
@ -272,7 +272,7 @@ impl World {
|
|||||||
/// let a = world.spawn((123, true, "abc"));
|
/// let a = world.spawn((123, true, "abc"));
|
||||||
/// // The returned query must outlive the borrow made by `get`
|
/// // The returned query must outlive the borrow made by `get`
|
||||||
/// let mut query = world.query_one::<(&mut i32, &bool)>(a).unwrap();
|
/// 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; }
|
/// if *flag { *number *= 2; }
|
||||||
/// assert_eq!(*number, 246);
|
/// assert_eq!(*number, 246);
|
||||||
/// ```
|
/// ```
|
||||||
|
|||||||
@ -8,12 +8,11 @@
|
|||||||
//!
|
//!
|
||||||
//! ## Example
|
//! ## Example
|
||||||
//!Here is a simple "Hello World" Bevy app:
|
//!Here is a simple "Hello World" Bevy app:
|
||||||
//! ```no_run
|
//! ```
|
||||||
//!use bevy::prelude::*;
|
//!use bevy::prelude::*;
|
||||||
//!
|
//!
|
||||||
//!fn main() {
|
//!fn main() {
|
||||||
//! App::build()
|
//! App::build()
|
||||||
//! .add_default_plugins()
|
|
||||||
//! .add_system(hello_world_system.system())
|
//! .add_system(hello_world_system.system())
|
||||||
//! .run();
|
//! .run();
|
||||||
//!}
|
//!}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user