Skip to content

Commit 5b72d3e

Browse files
committed
Fix some weak warnings
1 parent d050f0c commit 5b72d3e

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

src/ai.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
use crate::cell::*;
12
use crate::gamemanager::*;
23
use crate::movement::*;
34
use crate::units::*;
4-
use crate::{cell::*, movement};
55

66
#[derive(Default)]
77
pub(crate) struct AICache {
@@ -163,7 +163,7 @@ fn get_possible_moves(board: &Board, units: &Units, team: Team) -> Vec<GameMove>
163163
if unit.team != team {
164164
continue;
165165
}
166-
for move_to in movement::get_unit_moves(unit, board, units) {
166+
for move_to in get_unit_moves(unit, board, units) {
167167
output.push(GameMove {
168168
from: unit.coords,
169169
to: move_to,

src/cell.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ impl CellCoordinates {
6363
pub(crate) fn get_adjacent(&self, cube_side_length: u32) -> [CellCoordinates; 4] {
6464
let mut output: [CellCoordinates; 4] = Default::default();
6565
let mut i = 0;
66-
for direction in utils::CartesianDirection::directions() {
66+
for direction in CartesianDirection::directions() {
6767
let adjacent = self.get_cell_in_direction(direction, cube_side_length);
6868

6969
if adjacent.is_none() {

src/scene.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pub(crate) fn construct_cube(
4444
}
4545

4646
let plane_mesh: Handle<Mesh> = meshes.add(shape::Plane::default().into());
47-
let spacing = 1. / (side_length) as f32;
47+
let spacing = 1. / side_length as f32;
4848
let offset = 0.5 - spacing / 2.;
4949
// The total side length of cube is always 1, so we offset
5050
// by 0.5 to get middle in origo. When cube at origo, half of its side is in negative

src/units.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ impl Units {
124124
self.units.push(unit)
125125
}
126126

127+
//noinspection RsLiveness
127128
pub(crate) fn game_starting_configuration(cube_side_length: u32) -> Units {
128129
let mut output = Units::default();
129130
macro_rules! unit_mirror {

0 commit comments

Comments
 (0)