Skip to content

Commit

Permalink
Fix clippy lints and failed test with Rust 1.66
Browse files Browse the repository at this point in the history
  • Loading branch information
rparrett committed Dec 13, 2022
1 parent 79b9231 commit 325dfbb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
4 changes: 1 addition & 3 deletions crates/bevy_ecs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1551,9 +1551,7 @@ mod tests {
world_a.flush();

let world_a_max_entities = world_a.entities().len();
world_b
.entities
.reserve_entities(world_a_max_entities as u32);
world_b.entities.reserve_entities(world_a_max_entities);
world_b.entities.flush_as_invalid();

let e4 = world_b.spawn(A(4)).id();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
error[E0499]: cannot borrow `iter` as mutable more than once at a time
--> tests/ui/system_query_iter_many_mut_lifetime_safety.rs:9:25
|
9 | while let Some(a) = iter.fetch_next() {
| ^^^^^^^^^^^^^^^^^ `iter` was mutably borrowed here in the previous iteration of the loop
--> tests/ui/system_query_iter_many_mut_lifetime_safety.rs:9:25
|
9 | while let Some(a) = iter.fetch_next() {
| ^^^^^^^^^^^^^^^^^ `iter` was mutably borrowed here in the previous iteration of the loop
10 | // this should fail to compile
11 | results.push(a);
| --------------- first borrow used here, in later iteration of loop
2 changes: 1 addition & 1 deletion crates/bevy_render/src/mesh/shape/cylinder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ impl From<Cylinder> for Mesh {
uvs.push([0.5 * (cos + 1.0), 1.0 - 0.5 * (sin + 1.0)]);
}

for i in 1..(c.resolution as u32 - 1) {
for i in 1..(c.resolution - 1) {
indices.extend_from_slice(&[
offset,
offset + i + winding.0,
Expand Down
2 changes: 1 addition & 1 deletion examples/tools/scene_viewer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
info!("Loading {}", scene_path);
let (file_path, scene_index) = parse_scene(scene_path);
commands.insert_resource(SceneHandle {
gltf_handle: asset_server.load(&file_path),
gltf_handle: asset_server.load(file_path),
scene_index,
#[cfg(feature = "animation")]
animations: Vec::new(),
Expand Down

0 comments on commit 325dfbb

Please sign in to comment.