added clippy, added default.nix, minor code changes
4 files changed, 66 insertions(+), 20 deletions(-)

M Cargo.lock
M Cargo.toml
A => default.nix
M src/main.rs
M Cargo.lock +46 -14
@@ 2,28 2,47 @@ 
 name = "cursedlife"
 version = "0.0.1"
 dependencies = [
- "getopts 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
+ "clippy 0.0.11 (registry+https://github.com/rust-lang/crates.io-index)",
+ "getopts 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)",
  "ncurses 5.73.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rand 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "time 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rand 0.3.10 (registry+https://github.com/rust-lang/crates.io-index)",
+ "time 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
-name = "gcc"
-version = "0.3.8"
+name = "advapi32-sys"
+version = "0.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "winapi 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
+name = "clippy"
+version = "0.0.11"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "getopts"
-version = "0.2.11"
+version = "0.2.13"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
+name = "kernel32-sys"
+version = "0.1.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "winapi 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
+[[package]]
 name = "libc"
-version = "0.1.8"
+version = "0.1.10"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]

          
@@ 31,7 50,7 @@ name = "log"
 version = "0.3.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]

          
@@ 39,23 58,36 @@ name = "ncurses"
 version = "5.73.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "rand"
-version = "0.3.8"
+version = "0.3.10"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "advapi32-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "time"
-version = "0.1.26"
+version = "0.1.32"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "gcc 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "kernel32-sys 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
+ "winapi 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
+[[package]]
+name = "winapi"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
+[[package]]
+name = "winapi-build"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+

          
M Cargo.toml +2 -1
@@ 1,10 1,11 @@ 
 [package]
 name = "cursedlife"
 version = "0.0.1"
-authors = ["dermetfan"]
+authors = ["dermetfan <serverkorken@gmail.com>"]
 
 [dependencies]
 ncurses = "5.73"
 time = "0.1"
 rand = "0.3"
 getopts = "0.2"
+clippy = "0.0"

          
A => default.nix +10 -0
@@ 0,0 1,10 @@ 
+with import <nixpkgs> { };
+with rustUnstable;
+with ncurses;
+
+buildRustPackage {
+  name = "cursedlife";
+  src = ./.;
+  buildInputs = [ ncurses ];
+  depsSha256 = "";
+}

          
M src/main.rs +8 -5
@@ 3,6 3,9 @@ 
 // terms of the Do What The Fuck You Want To Public License, Version 2,
 // as published by Sam Hocevar. See the LICENSE file for more details.
 
+#![feature(plugin)]
+#![plugin(clippy)]
+
 extern crate ncurses;
 extern crate time;
 extern crate rand;

          
@@ 16,7 19,7 @@ fn main() {
     const BG_COLORS: i16 = 0;
     const CURSOR_COLORS: i16 = 1;
 
-    let init_ncurses = || {
+    fn init_ncurses() {
         initscr();
         cbreak();
         noecho();

          
@@ 26,16 29,16 @@ fn main() {
         start_color();
         init_pair(BG_COLORS, COLOR_WHITE, COLOR_BLACK);
         init_pair(CURSOR_COLORS, COLOR_BLACK, COLOR_YELLOW);
-    };
-    let end_ncurses = || {
+    }
+    fn end_ncurses() {
         echo();
         nocbreak();
         endwin();
     };
-    let exit_with_msg = |code: i32, msg: &str| {
+    fn exit_with_msg(code: i32, msg: &str) {
         println!("{}", msg);
         std::process::exit(code);
-    };
+    }
 
     const ARG_HELP: &'static str = "help";
     const ARG_ROWS: &'static str = "rows";