Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace .iter().copied() on arrays with .into_iter() #382

Merged
merged 2 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ pub struct CoordAxisOutOfBounds;
impl CoordAxis {
/// Iterates through the the axes in ascending order
pub fn iter() -> impl ExactSizeIterator<Item = Self> {
[Self::X, Self::Y, Self::Z].iter().copied()
[Self::X, Self::Y, Self::Z].into_iter()
}

/// Returns the pair axes orthogonal to the current axis
Expand Down
4 changes: 2 additions & 2 deletions server/src/sim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,9 @@ impl Sim {
populate_fresh_nodes(&mut self.graph);

let mut fresh_voxel_data = vec![];
for fresh_node in fresh_nodes.iter().copied() {
for fresh_node in (&fresh_nodes).into_iter() {
Ralith marked this conversation as resolved.
Show resolved Hide resolved
for vertex in Vertex::iter() {
let chunk = ChunkId::new(fresh_node, vertex);
let chunk = ChunkId::new(*fresh_node, vertex);
if let Some(voxel_data) = self.preloaded_voxel_data.remove(&chunk) {
fresh_voxel_data.push((chunk, voxel_data.serialize(self.cfg.chunk_size)));
self.modified_chunks.insert(chunk);
Expand Down