Created
July 20, 2016 09:10
-
-
Save llogiq/48b44727403cca1177eb1119eb79ef57 to your computer and use it in GitHub Desktop.
clippy run of ai2048
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Compiling ai2048 v0.1.0 (file:///home/andre/projects/ai2048) | |
warning: you should put `ExpectiMax` between ticks in the documentation, #[warn(doc_markdown)] on by default | |
--> src/searcher.rs:1:64 | |
|> | |
1 |> //! This is the meat of the library. This module implements an ExpectiMax search | |
|> ^^^^^^^^^^ | |
help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#doc_markdown | |
warning: you should put `Expectiminimax_tree` between ticks in the documentation, #[warn(doc_markdown)] on by default | |
--> src/searcher.rs:2:36 | |
|> | |
2 |> //! (https://en.wikipedia.org/wiki/Expectiminimax_tree - we don't need a MIN node, since | |
|> ^^^^^^^^^^^^^^^^^^^ | |
help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#doc_markdown | |
warning: you should put `ExpectiMax` between ticks in the documentation, #[warn(doc_markdown)] on by default | |
--> src/searcher.rs:29:57 | |
|> | |
29 |> /// but I don't think I'll find a better algorithm than ExpectiMax now. | |
|> ^^^^^^^^^^ | |
help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#doc_markdown | |
warning: returning the result of a let binding from a block. Consider returning the expression directly., #[warn(let_and_return)] on by default | |
--> src/searcher.rs:234:9 | |
|> | |
234 |> max | |
|> ^^^ | |
note: this expression can be directly returned | |
--> src/searcher.rs:228:19 | |
|> | |
228 |> let max = children.values() | |
|> ^ | |
help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#let_and_return | |
warning: missing documentation for a struct | |
--> src/board.rs:17:1 | |
|> | |
17 |> pub struct Board { | |
|> ^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a variant | |
--> src/board.rs:24:5 | |
|> | |
24 |> Left, | |
|> ^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a variant | |
--> src/board.rs:25:5 | |
|> | |
25 |> Right, | |
|> ^^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a variant | |
--> src/board.rs:26:5 | |
|> | |
26 |> Up, | |
|> ^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a variant | |
--> src/board.rs:27:5 | |
|> | |
27 |> Down, | |
|> ^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: using `clone` on a `Copy` type, #[warn(clone_on_copy)] on by default | |
--> src/board.rs:97:24 | |
|> | |
97 |> let mut flat = self.flatten().clone(); | |
|> ^^^^^^^^^^^^^^^^^^^^^^ | |
help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#clone_on_copy | |
warning: the loop variable `x` is only used to index `flat`., #[warn(needless_range_loop)] on by default | |
--> src/board.rs:109:9 | |
|> | |
109 |> for x in 0..16 { | |
|> ^ | |
help: consider using an iterator | |
src/board.rs: for <item> in flat.iter().take(16) { | |
help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_range_loop | |
warning: manual implementation of an assign operation, #[warn(assign_op_pattern)] on by default | |
--> src/board.rs:119:13 | |
|> | |
119 |> position = position - 1; | |
|> ^^^^^^^^^^^^^^^^^^^^^^^ | |
help: replace it with | |
src/board.rs: position -= 1; | |
help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#assign_op_pattern | |
warning: using `clone` on a `Copy` type, #[warn(clone_on_copy)] on by default | |
--> src/board.rs:163:41 | |
|> | |
163 |> let mut possible_grid = self.grid.clone(); | |
|> ^^^^^^^^^^^^^^^^^ | |
help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#clone_on_copy | |
warning: the loop variable `x` is used to index `result`, #[warn(needless_range_loop)] on by default | |
--> src/board.rs:176:9 | |
|> | |
176 |> for x in 0..4 { | |
|> ^ | |
help: consider using an iterator | |
src/board.rs: for (x, <item>) in result.iter().enumerate().take(4) { | |
help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_range_loop | |
warning: manual implementation of an assign operation, #[warn(assign_op_pattern)] on by default | |
--> src/board.rs:195:21 | |
|> | |
195 |> last_index = last_index + 1; | |
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
help: replace it with | |
src/board.rs: last_index += 1; | |
help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#assign_op_pattern | |
warning: manual implementation of an assign operation, #[warn(assign_op_pattern)] on by default | |
--> src/board.rs:201:17 | |
|> | |
201 |> last_index = last_index + 1; | |
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
help: replace it with | |
src/board.rs: last_index += 1; | |
help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#assign_op_pattern | |
warning: the loop variable `x` is used to index `result`, #[warn(needless_range_loop)] on by default | |
--> src/board.rs:216:9 | |
|> | |
216 |> for x in 0..4 { | |
|> ^ | |
help: consider using an iterator | |
src/board.rs: for (x, <item>) in result.iter().enumerate().take(4) { | |
help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_range_loop | |
warning: manual implementation of an assign operation, #[warn(assign_op_pattern)] on by default | |
--> src/board.rs:235:21 | |
|> | |
235 |> last_index = last_index - 1; | |
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
help: replace it with | |
src/board.rs: last_index -= 1; | |
help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#assign_op_pattern | |
warning: manual implementation of an assign operation, #[warn(assign_op_pattern)] on by default | |
--> src/board.rs:241:17 | |
|> | |
241 |> last_index = last_index - 1; | |
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
help: replace it with | |
src/board.rs: last_index -= 1; | |
help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#assign_op_pattern | |
warning: manual implementation of an assign operation, #[warn(assign_op_pattern)] on by default | |
--> src/board.rs:275:21 | |
|> | |
275 |> last_index = last_index + 1; | |
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
help: replace it with | |
src/board.rs: last_index += 1; | |
help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#assign_op_pattern | |
warning: manual implementation of an assign operation, #[warn(assign_op_pattern)] on by default | |
--> src/board.rs:281:17 | |
|> | |
281 |> last_index = last_index + 1; | |
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
help: replace it with | |
src/board.rs: last_index += 1; | |
help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#assign_op_pattern | |
warning: manual implementation of an assign operation, #[warn(assign_op_pattern)] on by default | |
--> src/board.rs:315:21 | |
|> | |
315 |> last_index = last_index - 1; | |
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
help: replace it with | |
src/board.rs: last_index -= 1; | |
help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#assign_op_pattern | |
warning: manual implementation of an assign operation, #[warn(assign_op_pattern)] on by default | |
--> src/board.rs:321:17 | |
|> | |
321 |> last_index = last_index - 1; | |
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
help: replace it with | |
src/board.rs: last_index -= 1; | |
help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#assign_op_pattern | |
warning: missing documentation for a module | |
--> src/lib.rs:25:1 | |
|> | |
25 |> pub mod heuristic; | |
|> ^^^^^^^^^^^^^^^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a module | |
--> src/heuristic/mod.rs:3:1 | |
|> | |
3 |> pub mod heat_map; | |
|> ^^^^^^^^^^^^^^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a struct | |
--> src/heuristic/heat_map.rs:19:1 | |
|> | |
19 |> pub struct HeatMapHeuristic { | |
|> ^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: the loop variable `x` is only used to index `grid`., #[warn(needless_range_loop)] on by default | |
--> src/heuristic/heat_map.rs:72:9 | |
|> | |
72 |> for x in 0..4 { | |
|> ^ | |
help: consider using an iterator | |
src/heuristic/heat_map.rs: for <item> in grid.iter().take(4) { | |
help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_range_loop | |
warning: missing documentation for a method | |
--> src/heuristic/heat_map.rs:91:5 | |
|> | |
91 |> pub fn new() -> HeatMapHeuristic { | |
|> ^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: you should consider deriving a `Default` implementation for `heuristic::heat_map::HeatMapHeuristic`, #[warn(new_without_default_derive)] on by default | |
--> src/heuristic/heat_map.rs:91:5 | |
|> | |
91 |> pub fn new() -> HeatMapHeuristic { | |
|> ^ | |
help: try this | |
src/heuristic/heat_map.rs: #[derive(Default)] | |
src/heuristic/heat_map.rs: pub fn new() -> HeatMapHeuristic { | |
help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#new_without_default_derive | |
warning: the loop variable `x` is used to index `heat_maps`, #[warn(needless_range_loop)] on by default | |
--> src/heuristic/heat_map.rs:95:9 | |
|> | |
95 |> for x in 1..4 { | |
|> ^ | |
help: consider using an iterator | |
src/heuristic/heat_map.rs: for (x, <item>) in heat_maps.iter().enumerate().take(4).skip(1) { | |
help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_range_loop | |
warning: the loop variable `x` is used to index `heat_maps`, #[warn(needless_range_loop)] on by default | |
--> src/heuristic/heat_map.rs:99:9 | |
|> | |
99 |> for x in 0..4 { | |
|> ^ | |
help: consider using an iterator | |
src/heuristic/heat_map.rs: for (x, <item>) in heat_maps.iter().enumerate().take(4) { | |
help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_range_loop | |
warning: the loop variable `x` is used to index `heat_map`, #[warn(needless_range_loop)] on by default | |
--> src/heuristic/heat_map.rs:108:9 | |
|> | |
108 |> for x in 0..4 { | |
|> ^ | |
help: consider using an iterator | |
src/heuristic/heat_map.rs: for (x, <item>) in heat_map.iter().enumerate().take(4) { | |
help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_range_loop | |
warning: the loop variable `y` is used to index `new`, #[warn(needless_range_loop)] on by default | |
--> src/heuristic/heat_map.rs:109:13 | |
|> | |
109 |> for y in 0..4 { | |
|> ^ | |
help: consider using an iterator | |
src/heuristic/heat_map.rs: for (y, <item>) in new.iter().enumerate().take(4) { | |
help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_range_loop | |
warning: the loop variable `x` is used to index `heat_map`, #[warn(needless_range_loop)] on by default | |
--> src/heuristic/heat_map.rs:119:9 | |
|> | |
119 |> for x in 0..4 { | |
|> ^ | |
help: consider using an iterator | |
src/heuristic/heat_map.rs: for (x, <item>) in heat_map.iter().enumerate().take(4) { | |
help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_range_loop | |
warning: the loop variable `y` is used to index `new`, #[warn(needless_range_loop)] on by default | |
--> src/heuristic/heat_map.rs:120:13 | |
|> | |
120 |> for y in 0..4 { | |
|> ^ | |
help: consider using an iterator | |
src/heuristic/heat_map.rs: for (y, <item>) in new.iter().enumerate().take(4) { | |
help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_range_loop | |
warning: missing documentation for a module | |
--> src/heuristic/mod.rs:4:1 | |
|> | |
4 |> pub mod composite; | |
|> ^^^^^^^^^^^^^^^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a struct | |
--> src/heuristic/composite.rs:6:1 | |
|> | |
6 |> pub struct CompositeHeuristic; | |
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a method | |
--> src/heuristic/composite.rs:9:5 | |
|> | |
9 |> pub fn new() -> Self { | |
|> ^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: you should consider deriving a `Default` implementation for `heuristic::composite::CompositeHeuristic`, #[warn(new_without_default_derive)] on by default | |
--> src/heuristic/composite.rs:9:5 | |
|> | |
9 |> pub fn new() -> Self { | |
|> ^ | |
help: try this | |
src/heuristic/composite.rs: #[derive(Default)] | |
src/heuristic/composite.rs: pub fn new() -> Self { | |
help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#new_without_default_derive | |
warning: missing documentation for a trait | |
--> src/heuristic/mod.rs:10:1 | |
|> | |
10 |> pub trait Heuristic { | |
|> ^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a trait method | |
--> src/heuristic/mod.rs:11:5 | |
|> | |
11 |> fn eval(&self, &PlayerNode) -> f64; | |
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: the loop variable `x` is only used to index `grid`., #[warn(needless_range_loop)] on by default | |
--> src/heuristic/mod.rs:35:5 | |
|> | |
35 |> for x in 0..4 { | |
|> ^ | |
help: consider using an iterator | |
src/heuristic/mod.rs: for <item> in grid.iter().take(4) { | |
help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_range_loop | |
warning: the loop variable `x` is only used to index `grid`., #[warn(needless_range_loop)] on by default | |
--> src/heuristic/mod.rs:56:5 | |
|> | |
56 |> for x in 0..4 { | |
|> ^ | |
help: consider using an iterator | |
src/heuristic/mod.rs: for <item> in grid.iter().take(4) { | |
help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_range_loop | |
warning: the loop variable `cell_x` is used to index `grid`, #[warn(needless_range_loop)] on by default | |
--> src/heuristic/mod.rs:122:9 | |
|> | |
122 |> for cell_x in 0..4 { | |
|> ^ | |
help: consider using an iterator | |
src/heuristic/mod.rs: for (cell_x, <item>) in grid.iter().enumerate().take(4) { | |
help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#needless_range_loop | |
warning: item `search_tree::cache::Cache<K, V>` has a `.len(_: &Self)` method, but no `.is_empty(_: &Self)` method. Consider adding one, #[warn(len_without_is_empty)] on by default | |
--> src/search_tree/cache.rs:45:5 | |
|> | |
45 |> pub fn len(&self) -> usize { | |
|> ^ | |
help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#len_without_is_empty | |
warning: very complex type used. Consider factoring parts into `type` definitions, #[warn(type_complexity)] on by default | |
--> src/search_tree/mod.rs:105:15 | |
|> | |
105 |> children: RefCell<Option<Rc<HashMap<Move, Rc<ComputerNode>>>>>, | |
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#type_complexity | |
warning: missing documentation for a struct field | |
--> src/search_tree/mod.rs:109:5 | |
|> | |
109 |> pub heuristic: Cell<Option<f64>>, | |
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: it is more idiomatic to loop over `&board::MOVES` instead of `board::MOVES.iter()`, #[warn(explicit_iter_loop)] on by default | |
--> src/search_tree/mod.rs:152:9 | |
|> | |
152 |> for m in board::MOVES.iter() { | |
|> ^ | |
help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#explicit_iter_loop | |
warning: missing documentation for a struct field | |
--> src/search_tree/mod.rs:175:5 | |
|> | |
175 |> pub with2: Vec<Rc<PlayerNode>>, | |
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a struct field | |
--> src/search_tree/mod.rs:176:5 | |
|> | |
176 |> pub with4: Vec<Rc<PlayerNode>>, | |
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a struct field | |
--> src/searcher.rs:43:5 | |
|> | |
43 |> pub search_statistics: SearchStatistics, | |
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a struct field | |
--> src/searcher.rs:44:5 | |
|> | |
44 |> pub root_board: Board, | |
|> ^^^^^^^^^^^^^^^^^^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a struct field | |
--> src/searcher.rs:45:5 | |
|> | |
45 |> pub move_evaluations: HashMap<Move, f64>, | |
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a struct field | |
--> src/searcher.rs:46:5 | |
|> | |
46 |> pub best_move: Option<(Move, f64)>, | |
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a struct field | |
--> src/searcher.rs:51:5 | |
|> | |
51 |> pub search_duration: Duration, | |
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a struct field | |
--> src/searcher.rs:52:5 | |
|> | |
52 |> pub nodes_traversed: usize, | |
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a struct field | |
--> src/searcher.rs:53:5 | |
|> | |
53 |> pub terminal_traversed: usize, | |
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a struct field | |
--> src/searcher.rs:54:5 | |
|> | |
54 |> pub known_player_nodes: usize, | |
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a struct field | |
--> src/searcher.rs:55:5 | |
|> | |
55 |> pub known_computer_nodes: usize, | |
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a struct field | |
--> src/searcher.rs:56:5 | |
|> | |
56 |> pub new_player_nodes: usize, | |
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a struct field | |
--> src/searcher.rs:57:5 | |
|> | |
57 |> pub new_computer_nodes: usize, | |
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: length comparison to zero, #[warn(len_zero)] on by default | |
--> src/searcher.rs:139:28 | |
|> | |
139 |> let best_move = if hashmap.len() > 0 { | |
|> ^^^^^^^^^^^^^^^^^ | |
help: consider using `is_empty` | |
src/searcher.rs: let best_move = if !hashmap.is_empty() { | |
help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#len_zero | |
warning: you seem to be using .map() to clone the contents of an iterator, consider using `.cloned()`, #[warn(map_clone)] on by default | |
--> src/searcher.rs:140:29 | |
|> | |
140 |> let best_eval = hashmap.values().map(|&v| v).fold(f64::NAN, f64::max); | |
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
help: try | |
hashmap.values().cloned() | |
help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#map_clone | |
warning: strict comparison of f32 or f64, #[warn(float_cmp)] on by default | |
--> src/searcher.rs:142:36 | |
|> | |
142 |> .filter(|&(_, &e)| e == best_eval) | |
|> ^^^^^^^^^^^^^^ | |
help: consider comparing them within some error | |
src/searcher.rs: .filter(|&(_, &e)| (e - best_eval).abs() < error) | |
note: std::f32::EPSILON and std::f64::EPSILON are available. | |
--> src/searcher.rs:142:36 | |
|> | |
142 |> .filter(|&(_, &e)| e == best_eval) | |
|> ^^^^^^^^^^^^^^ | |
help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#float_cmp | |
warning: using `clone` on a `Copy` type, #[warn(clone_on_copy)] on by default | |
--> src/searcher.rs:152:25 | |
|> | |
152 |> root_board: search_tree.get_root().get_board().clone(), | |
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#clone_on_copy | |
Compiling ai2048 v0.1.0 (file:///home/andre/projects/ai2048) | |
warning: missing documentation for a struct | |
--> src/board.rs:17:1 | |
|> | |
17 |> pub struct Board { | |
|> ^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a variant | |
--> src/board.rs:24:5 | |
|> | |
24 |> Left, | |
|> ^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a variant | |
--> src/board.rs:25:5 | |
|> | |
25 |> Right, | |
|> ^^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a variant | |
--> src/board.rs:26:5 | |
|> | |
26 |> Up, | |
|> ^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a variant | |
--> src/board.rs:27:5 | |
|> | |
27 |> Down, | |
|> ^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a module | |
--> src/lib.rs:25:1 | |
|> | |
25 |> pub mod heuristic; | |
|> ^^^^^^^^^^^^^^^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a module | |
--> src/heuristic/mod.rs:3:1 | |
|> | |
3 |> pub mod heat_map; | |
|> ^^^^^^^^^^^^^^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a struct | |
--> src/heuristic/heat_map.rs:19:1 | |
|> | |
19 |> pub struct HeatMapHeuristic { | |
|> ^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a method | |
--> src/heuristic/heat_map.rs:91:5 | |
|> | |
91 |> pub fn new() -> HeatMapHeuristic { | |
|> ^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a module | |
--> src/heuristic/mod.rs:4:1 | |
|> | |
4 |> pub mod composite; | |
|> ^^^^^^^^^^^^^^^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a struct | |
--> src/heuristic/composite.rs:6:1 | |
|> | |
6 |> pub struct CompositeHeuristic; | |
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a method | |
--> src/heuristic/composite.rs:9:5 | |
|> | |
9 |> pub fn new() -> Self { | |
|> ^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a trait | |
--> src/heuristic/mod.rs:10:1 | |
|> | |
10 |> pub trait Heuristic { | |
|> ^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a trait method | |
--> src/heuristic/mod.rs:11:5 | |
|> | |
11 |> fn eval(&self, &PlayerNode) -> f64; | |
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a struct field | |
--> src/search_tree/mod.rs:109:5 | |
|> | |
109 |> pub heuristic: Cell<Option<f64>>, | |
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a struct field | |
--> src/search_tree/mod.rs:175:5 | |
|> | |
175 |> pub with2: Vec<Rc<PlayerNode>>, | |
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a struct field | |
--> src/search_tree/mod.rs:176:5 | |
|> | |
176 |> pub with4: Vec<Rc<PlayerNode>>, | |
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a struct field | |
--> src/searcher.rs:43:5 | |
|> | |
43 |> pub search_statistics: SearchStatistics, | |
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a struct field | |
--> src/searcher.rs:44:5 | |
|> | |
44 |> pub root_board: Board, | |
|> ^^^^^^^^^^^^^^^^^^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a struct field | |
--> src/searcher.rs:45:5 | |
|> | |
45 |> pub move_evaluations: HashMap<Move, f64>, | |
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a struct field | |
--> src/searcher.rs:46:5 | |
|> | |
46 |> pub best_move: Option<(Move, f64)>, | |
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a struct field | |
--> src/searcher.rs:51:5 | |
|> | |
51 |> pub search_duration: Duration, | |
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a struct field | |
--> src/searcher.rs:52:5 | |
|> | |
52 |> pub nodes_traversed: usize, | |
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a struct field | |
--> src/searcher.rs:53:5 | |
|> | |
53 |> pub terminal_traversed: usize, | |
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a struct field | |
--> src/searcher.rs:54:5 | |
|> | |
54 |> pub known_player_nodes: usize, | |
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a struct field | |
--> src/searcher.rs:55:5 | |
|> | |
55 |> pub known_computer_nodes: usize, | |
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a struct field | |
--> src/searcher.rs:56:5 | |
|> | |
56 |> pub new_player_nodes: usize, | |
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: missing documentation for a struct field | |
--> src/searcher.rs:57:5 | |
|> | |
57 |> pub new_computer_nodes: usize, | |
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
note: lint level defined here | |
--> src/lib.rs:1:9 | |
|> | |
1 |> #![warn(missing_docs)] | |
|> ^^^^^^^^^^^^ | |
warning: it is more idiomatic to loop over `&ai2048::board::MOVES` instead of `ai2048::board::MOVES.iter()`, #[warn(explicit_iter_loop)] on by default | |
--> src/main.rs:18:9 | |
|> | |
18 |> for mv in ai2048::board::MOVES.iter() { | |
|> ^ | |
help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#explicit_iter_loop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment