Replace into_iter() -> iter() for arrays, fixes 1.42-nightly warning

warning: this method call currently resolves to `<&[T; N] as IntoIterator>::into_iter` (due to autoref coercions), but that might change in the future when `IntoIterator` impls for arrays are added.
   --> src/entity/player.rs:363:11
    |
363 |         ].into_iter().enumerate() {
    |           ^^^^^^^^^ help: use `.iter()` instead of `.into_iter()` to avoid ambiguity: `iter`
    |
    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
    = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
This commit is contained in:
ice_iix 2020-01-04 19:09:00 -08:00
parent 8502c031f8
commit 20bcddfb13
5 changed files with 10 additions and 10 deletions

View File

@ -360,7 +360,7 @@ impl ecs::System for PlayerRenderer {
[0.0, 16.0, 0.0, 32.0], // Right Leg
[32.0, 48.0, 48.0, 48.0], // Left arm
[40.0, 16.0, 40.0, 32.0], // Right arm
].into_iter().enumerate() {
].iter().enumerate() {
let (ox, oy) = (offsets[0], offsets[1]);
model::append_box(&mut part_verts[i], -2.0/16.0, -12.0/16.0, -2.0/16.0, 4.0/16.0, 12.0/16.0, 4.0/16.0, [
srel!(ox + 8.0, oy + 0.0, 4.0, 4.0), // Down

View File

@ -965,9 +965,9 @@ fn calculate_light(snapshot: &world::Snapshot, orig_x: i32, orig_y: i32, orig_z:
let dy = (oy as f64) * 0.6;
let dz = (oz as f64) * 0.6;
for ox in [-0.6, 0.0].into_iter() {
for oy in [-0.6, 0.0].into_iter() {
for oz in [-0.6, 0.0].into_iter() {
for ox in [-0.6, 0.0].iter() {
for oy in [-0.6, 0.0].iter() {
for oz in [-0.6, 0.0].iter() {
let lx = (x + ox + dx).round() as i32;
let ly = (y + oy + dy).round() as i32;
let lz = (z + oz + dz).round() as i32;

View File

@ -359,7 +359,7 @@ impl Renderer {
gl::clear_buffer(gl::COLOR, 1, &[0.0, 0.0, 0.0, 0.0]);
gl::blend_func_separate(gl::ONE_FACTOR, gl::ONE_FACTOR, gl::ZERO_FACTOR, gl::ONE_MINUS_SRC_ALPHA);
for (pos, info) in world.get_render_list().into_iter().rev() {
for (pos, info) in world.get_render_list().iter().rev() {
if let Some(trans) = info.trans.as_ref() {
if trans.count > 0 {
self.chunk_shader_alpha.offset.set_int3(pos.0, pos.1 * 4096, pos.2);
@ -737,7 +737,7 @@ impl TransInfo {
buffer.bind(gl::ARRAY_BUFFER);
let mut data = vec![];
for f in [-1.0, 1.0, 1.0, -1.0, -1.0, -1.0, 1.0, 1.0, 1.0, -1.0, -1.0, 1.0].into_iter() {
for f in [-1.0, 1.0, 1.0, -1.0, -1.0, -1.0, 1.0, 1.0, 1.0, -1.0, -1.0, 1.0].iter() {
data.write_f32::<NativeEndian>(*f).unwrap();
}
buffer.set_data(gl::ARRAY_BUFFER, &data, gl::STATIC_DRAW);
@ -938,7 +938,7 @@ impl TextureManager {
(32, 48, 16, 16),
(40, 16, 16, 16),
];
for bl in blacklist.into_iter() {
for bl in blacklist.iter() {
for x in bl.0 .. (bl.0 + bl.2) {
for y in bl.1 .. (bl.1 + bl.3) {
let mut col = img.get_pixel(x, y);

View File

@ -50,7 +50,7 @@ impl Info {
(bound.min.x, bound.max.z),
(bound.max.x, bound.min.z),
(bound.max.x, bound.max.z),
].into_iter() {
].iter() {
model::append_box(&mut parts,
(point.0-LINE_SIZE) as f32, (bound.min.y-LINE_SIZE) as f32, (point.1-LINE_SIZE) as f32,
(LINE_SIZE*2.0) as f32, ((bound.max.y-bound.min.y)+LINE_SIZE*2.0) as f32, (LINE_SIZE*2.0) as f32,
@ -69,7 +69,7 @@ impl Info {
(bound.min.x, bound.max.z, bound.max.x, bound.max.z),
(bound.min.x, bound.min.z, bound.min.x, bound.max.z),
(bound.max.x, bound.min.z, bound.max.x, bound.max.z),
].into_iter() {
].iter() {
model::append_box(&mut parts,
(point.0-LINE_SIZE) as f32, (bound.min.y-LINE_SIZE) as f32, (point.1-LINE_SIZE) as f32,
((point.2-point.0)+(LINE_SIZE*2.0)) as f32, (LINE_SIZE*2.0) as f32, ((point.3-point.1)+(LINE_SIZE*2.0)) as f32,

View File

@ -574,7 +574,7 @@ impl World {
for pos in [
(-1, 0, 0), (1, 0, 0),
(0, -1, 0), (0, 1, 0),
(0, 0, -1), (0, 0, 1)].into_iter() {
(0, 0, -1), (0, 0, 1)].iter() {
self.flag_section_dirty(x + pos.0, i as i32 + pos.1, z + pos.2);
}
self.update_range(