mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
fix some doc tests
This commit is contained in:
parent
70b12452b5
commit
89af5ea4e0
3 changed files with 3 additions and 4 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
/// ```
|
||||
|
|
|
@ -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();
|
||||
//!}
|
||||
|
|
Loading…
Reference in a new issue