Skip to content

Commit

Permalink
Fix some weak warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
confusinguser committed Jun 19, 2024
1 parent d050f0c commit 5b72d3e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/ai.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::cell::*;
use crate::gamemanager::*;
use crate::movement::*;
use crate::units::*;
use crate::{cell::*, movement};

#[derive(Default)]
pub(crate) struct AICache {
Expand Down Expand Up @@ -163,7 +163,7 @@ fn get_possible_moves(board: &Board, units: &Units, team: Team) -> Vec<GameMove>
if unit.team != team {
continue;
}
for move_to in movement::get_unit_moves(unit, board, units) {
for move_to in get_unit_moves(unit, board, units) {
output.push(GameMove {
from: unit.coords,
to: move_to,
Expand Down
2 changes: 1 addition & 1 deletion src/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl CellCoordinates {
pub(crate) fn get_adjacent(&self, cube_side_length: u32) -> [CellCoordinates; 4] {
let mut output: [CellCoordinates; 4] = Default::default();
let mut i = 0;
for direction in utils::CartesianDirection::directions() {
for direction in CartesianDirection::directions() {
let adjacent = self.get_cell_in_direction(direction, cube_side_length);

if adjacent.is_none() {
Expand Down
2 changes: 1 addition & 1 deletion src/scene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub(crate) fn construct_cube(
}

let plane_mesh: Handle<Mesh> = meshes.add(shape::Plane::default().into());
let spacing = 1. / (side_length) as f32;
let spacing = 1. / side_length as f32;
let offset = 0.5 - spacing / 2.;
// The total side length of cube is always 1, so we offset
// by 0.5 to get middle in origo. When cube at origo, half of its side is in negative
Expand Down
1 change: 1 addition & 0 deletions src/units.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ impl Units {
self.units.push(unit)
}

//noinspection RsLiveness
pub(crate) fn game_starting_configuration(cube_side_length: u32) -> Units {
let mut output = Units::default();
macro_rules! unit_mirror {
Expand Down

0 comments on commit 5b72d3e

Please sign in to comment.