From a5c2ea423d16e269e66fe08880034e4aa2f8f848 Mon Sep 17 00:00:00 2001 From: Tomas Sedovic Date: Fri, 6 Feb 2015 15:29:12 +0100 Subject: [PATCH 1/2] Silence warnings and update examples to rust master There's no need to specify the receiver time for unboxed closures anymore and `std::rand` was moved to `crates.io` as `rand`. --- Cargo.toml | 3 +++ examples/astar-path-finding.rs | 4 +++- examples/dijkstra-path-finding.rs | 4 +++- examples/fov.rs | 5 ++--- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 32dfb8236..ac1408d9c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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] diff --git a/examples/astar-path-finding.rs b/examples/astar-path-finding.rs index e39fc88d5..9bea1bf94 100644 --- a/examples/astar-path-finding.rs +++ b/examples/astar-path-finding.rs @@ -1,3 +1,5 @@ +#![feature(core)] + extern crate tcod; use tcod::AStarPath; @@ -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] { diff --git a/examples/dijkstra-path-finding.rs b/examples/dijkstra-path-finding.rs index 380477d20..440354ca7 100644 --- a/examples/dijkstra-path-finding.rs +++ b/examples/dijkstra-path-finding.rs @@ -1,3 +1,5 @@ +#![feature(core)] + extern crate tcod; use tcod::DijkstraPath; @@ -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] { diff --git a/examples/fov.rs b/examples/fov.rs index d9f488e09..efc120d43 100644 --- a/examples/fov.rs +++ b/examples/fov.rs @@ -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. From b0c0048d889174bc492493ffcd48f400fb45d4ee Mon Sep 17 00:00:00 2001 From: Tomas Sedovic Date: Fri, 6 Feb 2015 15:30:34 +0100 Subject: [PATCH 2/2] Bump tcod to 0.4.7 and tcod-sys to 2.0.4 --- Cargo.toml | 4 ++-- tcod-sys/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ac1408d9c..383b01eec 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "tcod" description = "The Rust bindings for the Doryen library (a.k.a. libtcod)." -version = "0.4.6" +version = "0.4.7" homepage = "https://github.com/tomassedovic/tcod-rs" repository = "https://github.com/tomassedovic/tcod-rs" readme = "README.md" @@ -25,7 +25,7 @@ bitflags = "0.1" [dependencies.tcod-sys] path = "tcod-sys" -version = "2.0.3" +version = "2.0.4" [dev-dependencies] rand = "0.1.2" diff --git a/tcod-sys/Cargo.toml b/tcod-sys/Cargo.toml index ebc8c225b..72348527b 100644 --- a/tcod-sys/Cargo.toml +++ b/tcod-sys/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "tcod-sys" description = "Raw FFI bindings & build script to link against libtcod." -version = "2.0.3" +version = "2.0.4" license = "WTFPL" homepage = "https://github.com/tomassedovic/tcod-rs" repository = "https://github.com/tomassedovic/tcod-rs/tree/master/tcod-sys"