diff --git a/Cargo.toml b/Cargo.toml index 1154c73..3cf3cfb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,7 @@ name = "rust_hanabi" version = "0.1.0" authors = ["Jeff Wu "] +edition = "2021" [dependencies] rand = "0.3.0" diff --git a/src/helpers.rs b/src/helpers.rs index 800756e..9f9e946 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -6,7 +6,7 @@ use std::hash::Hash; use std::ops::{Index, IndexMut}; use std::slice; -use game::*; +use crate::game::*; // trait representing information about a card pub trait CardInfo { diff --git a/src/main.rs b/src/main.rs index 69e03ed..0caef30 100644 --- a/src/main.rs +++ b/src/main.rs @@ -236,7 +236,7 @@ fn get_results_table() -> String { } fn concat_twolines(body: Vec) -> String { body.into_iter().fold(String::default(), |output, (a, b)| { - (output + &a + "\n" + &b + "\n") + output + &a + "\n" + &b + "\n" }) } let header = make_twolines(&player_nums, (space.clone(), dashes), &|n_players| { diff --git a/src/simulator.rs b/src/simulator.rs index fdcd105..884103b 100644 --- a/src/simulator.rs +++ b/src/simulator.rs @@ -1,10 +1,9 @@ -use crossbeam; use fnv::FnvHashMap; use rand::{self, Rng, SeedableRng}; use std::fmt; -use game::*; -use strategy::*; +use crate::game::*; +use crate::strategy::*; fn new_deck(seed: u32) -> Cards { let mut deck: Cards = Cards::new(); diff --git a/src/strategies/cheating.rs b/src/strategies/cheating.rs index 00a4da2..fe24cd2 100644 --- a/src/strategies/cheating.rs +++ b/src/strategies/cheating.rs @@ -2,8 +2,8 @@ use fnv::{FnvHashMap, FnvHashSet}; use std::cell::RefCell; use std::rc::Rc; -use game::*; -use strategy::*; +use crate::game::*; +use crate::strategy::*; // strategy that explicitly cheats by using Rc/RefCell // serves as a reference point for other strategies diff --git a/src/strategies/examples.rs b/src/strategies/examples.rs index 5b5f15f..a944a50 100644 --- a/src/strategies/examples.rs +++ b/src/strategies/examples.rs @@ -1,6 +1,6 @@ -use game::*; +use crate::game::*; +use crate::strategy::*; use rand::{self, Rng}; -use strategy::*; // dummy, terrible strategy, as an example #[derive(Clone)] diff --git a/src/strategies/hat_helpers.rs b/src/strategies/hat_helpers.rs index f4d94e0..bc01152 100644 --- a/src/strategies/hat_helpers.rs +++ b/src/strategies/hat_helpers.rs @@ -1,5 +1,5 @@ -use game::*; -use helpers::*; +use crate::game::*; +use crate::helpers::*; #[derive(Debug, Clone)] pub struct ModulusInformation { diff --git a/src/strategies/information.rs b/src/strategies/information.rs index baea99a..f2da8f5 100644 --- a/src/strategies/information.rs +++ b/src/strategies/information.rs @@ -2,10 +2,10 @@ use float_ord::*; use fnv::{FnvHashMap, FnvHashSet}; use std::cmp::Ordering; -use game::*; -use helpers::*; -use strategies::hat_helpers::*; -use strategy::*; +use crate::game::*; +use crate::helpers::*; +use crate::strategies::hat_helpers::*; +use crate::strategy::*; // TODO: use random extra information - i.e. when casting up and down, // we sometimes have 2 choices of value to choose diff --git a/src/strategy.rs b/src/strategy.rs index eade9b8..f688379 100644 --- a/src/strategy.rs +++ b/src/strategy.rs @@ -1,4 +1,4 @@ -use game::*; +use crate::game::*; // Traits to implement for any valid Hanabi strategy