Skip to content
This repository was archived by the owner on Jan 2, 2025. It is now read-only.

Commit

Permalink
Silence warnings and update examples to rust master
Browse files Browse the repository at this point in the history
There's no need to specify the receiver time for unboxed closures anymore and
`std::rand` was moved to `crates.io` as `rand`.
  • Loading branch information
tomassedovic committed Feb 6, 2015
1 parent f0afb96 commit a5c2ea4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ bitflags = "0.1"
path = "tcod-sys"
version = "2.0.3"

[dev-dependencies]
rand = "0.1.2"

# TODO: temporarily disabling debuginfo until this is fixed:
# https://github.com/rust-lang/rust/issues/17257
[profile.dev]
Expand Down
4 changes: 3 additions & 1 deletion examples/astar-path-finding.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![feature(core)]

extern crate tcod;

use tcod::AStarPath;
Expand All @@ -14,7 +16,7 @@ fn create_path() -> AStarPath<'static> {
[0, 1, 0, 1, 0, 1, 0, 1],
];
// Movement like in Checkers: you can only move to the square of the same colour
let can_move = move |&mut: from: (i32, i32), to: (i32, i32)| -> f32 {
let can_move = move |from: (i32, i32), to: (i32, i32)| -> f32 {
let (fx, fy) = from;
let (tx, ty) = to;
if chess_board[fy as usize][fx as usize] == chess_board[ty as usize][tx as usize] {
Expand Down
4 changes: 3 additions & 1 deletion examples/dijkstra-path-finding.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![feature(core)]

extern crate tcod;

use tcod::DijkstraPath;
Expand All @@ -14,7 +16,7 @@ fn create_path() -> DijkstraPath<'static> {
[0, 1, 0, 1, 0, 1, 0, 1],
];
// Movement like in Checkers: you can only move to the square of the same colour
let can_move = move |&mut: from: (i32, i32), to: (i32, i32)| -> f32 {
let can_move = move |from: (i32, i32), to: (i32, i32)| -> f32 {
let (fx, fy) = from;
let (tx, ty) = to;
if chess_board[fy as usize][fx as usize] == chess_board[ty as usize][tx as usize] {
Expand Down
5 changes: 2 additions & 3 deletions examples/fov.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#![feature(rand)]
#![feature(core)]

extern crate rand;
extern crate tcod;

use std::rand;

use tcod::{Console, BackgroundFlag, FovAlgorithm, Map};

// We'll use a basic structure to define our tiles.
Expand Down

0 comments on commit a5c2ea4

Please sign in to comment.