Skip to content

Commit

Permalink
fix some doc tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cart committed Jul 23, 2020
1 parent 70b1245 commit 89af5ea
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crates/bevy_ecs/hecs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_ecs/hecs/src/world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
/// ```
Expand Down
3 changes: 1 addition & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
//!}
Expand Down

0 comments on commit 89af5ea

Please sign in to comment.