From 5e0c041a711a19a6220821c2a3c2e96f0cbb1833 Mon Sep 17 00:00:00 2001 From: llogiq Date: Thu, 15 Sep 2016 16:15:52 +0200 Subject: [PATCH] Fixed another batch of clippy warnings Those are mostly readability-related. Also did a cargo update. --- Cargo.lock | 426 ++++++++++++++++++++++++++------------ src/chunk_builder.rs | 13 +- src/console/mod.rs | 13 +- src/ecs/mod.rs | 4 +- src/entity/mod.rs | 22 +- src/entity/player.rs | 32 ++- src/format.rs | 2 +- src/gl/mod.rs | 10 +- src/main.rs | 2 +- src/model/liquid.rs | 4 +- src/model/mod.rs | 24 +-- src/nbt/mod.rs | 2 +- src/render/glsl.rs | 9 +- src/render/mod.rs | 9 +- src/render/model.rs | 6 +- src/screen/edit_server.rs | 2 +- src/screen/mod.rs | 8 +- src/screen/server_list.rs | 4 +- src/server/mod.rs | 71 +++---- src/server/target.rs | 22 +- src/types/bit/set.rs | 2 +- src/types/metadata.rs | 1 - src/ui/mod.rs | 12 +- src/world/mod.rs | 26 +-- 24 files changed, 412 insertions(+), 314 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index eb71fb0..353a4dc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,26 +2,26 @@ name = "steven" version = "0.0.1" dependencies = [ - "byteorder 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", "cgmath 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "collision 0.5.1 (git+https://github.com/csherratt/collision-rs?rev=f80825e)", - "flate2 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "image 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)", + "flate2 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "image 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl 0.7.14 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", "sdl2 0.16.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.15 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", "steven_blocks 0.0.1", "steven_gl 0.0.1", "steven_resources 0.1.0", "steven_shared 0.0.1", - "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", - "zip 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", + "zip 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -31,7 +31,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "bitflags" -version = "0.4.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -41,7 +41,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "byteorder" -version = "0.5.1" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -50,7 +50,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bzip2-sys 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -58,8 +58,8 @@ name = "bzip2-sys" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "gcc 0.3.26 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -67,9 +67,9 @@ name = "cgmath" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)", + "num 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -78,7 +78,7 @@ version = "0.5.1" source = "git+https://github.com/csherratt/collision-rs?rev=f80825e#f80825eca687ff1053ff492e54fa782944c9cf6b" dependencies = [ "cgmath 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "num 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)", + "num 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -88,13 +88,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "cookie" -version = "0.2.2" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "openssl 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", - "url 0.5.7 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl 0.7.14 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -110,39 +110,30 @@ name = "enum_primitive" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "euclid" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", - "num 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)", + "num 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "flate2" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", "miniz-sys 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "gcc" -version = "0.3.26" +version = "0.3.35" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "gdi32-sys" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "winapi 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -160,7 +151,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "khronos_api 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "xml-rs 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -174,71 +165,84 @@ name = "hpack" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "httparse" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "hyper" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cookie 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "httparse 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "httparse 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", - "mime 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "mime 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl 0.7.14 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", "solicit 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", "traitobject 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "unicase 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "url 0.5.7 (registry+https://github.com/rust-lang/crates.io-index)", + "url 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "idna" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-bidi 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-normalization 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "image" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "enum_primitive 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "gif 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "jpeg-decoder 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "num 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)", - "png 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "jpeg-decoder 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "num 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", + "png 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "inflate" -version = "0.1.0" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "itoa" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "jpeg-decoder" -version = "0.1.2" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "euclid 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", - "num 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "kernel32-sys" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "winapi 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -254,12 +258,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "lazy_static" -version = "0.1.15" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "lazy_static" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "libc" -version = "0.2.8" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -272,11 +281,8 @@ dependencies = [ [[package]] name = "log" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", -] [[package]] name = "lzw" @@ -290,10 +296,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "mime" -version = "0.2.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -301,8 +307,8 @@ name = "miniz-sys" version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "gcc 0.3.26 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -310,61 +316,118 @@ name = "msdos_time" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "num" -version = "0.1.31" +version = "0.1.35" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)", + "num-bigint 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", + "num-complex 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", + "num-integer 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", + "num-iter 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", + "num-rational 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "num_cpus" -version = "0.2.11" +name = "num-bigint" +version = "0.1.35" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "num-integer 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num-complex" +version = "0.1.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num-traits 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num-integer" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num-traits 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num-iter" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num-integer 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num-rational" +version = "0.1.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num-bigint 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", + "num-integer 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num-traits" +version = "0.1.35" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "num_cpus" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "openssl" -version = "0.7.8" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bitflags 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gcc 0.3.26 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys-extras 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.7.17 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys-extras 0.7.14 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "openssl-sys" -version = "0.7.8" +version = "0.7.17" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "gdi32-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "gdi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", "libressl-pnacl-sys 2.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "user32-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "user32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "openssl-sys-extras" -version = "0.7.8" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "gcc 0.3.26 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.7.17 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -377,19 +440,19 @@ name = "pnacl-build-helper" version = "1.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "tempdir 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "png" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "flate2 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", - "inflate 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "num 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)", + "flate2 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", + "inflate 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", + "num-iter 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -402,22 +465,22 @@ name = "rand" version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rayon" -version = "0.3.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "deque 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rustc-serialize" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -434,9 +497,9 @@ version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "num 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", + "num 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", "sdl2-sys 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -446,7 +509,7 @@ name = "sdl2-sys" version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -456,16 +519,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde" -version = "0.7.0" +version = "0.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde_json" -version = "0.7.0" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.7.15 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -474,7 +538,7 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "hpack 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -483,7 +547,7 @@ version = "0.0.1" dependencies = [ "cgmath 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "collision 0.5.1 (git+https://github.com/csherratt/collision-rs?rev=f80825e)", - "lazy_static 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "steven_shared 0.0.1", ] @@ -493,7 +557,7 @@ version = "0.0.1" dependencies = [ "gl_generator 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "khronos_api 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -506,7 +570,7 @@ version = "0.0.1" [[package]] name = "tempdir" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", @@ -514,12 +578,12 @@ dependencies = [ [[package]] name = "time" -version = "0.1.34" +version = "0.1.35" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -555,37 +619,45 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "url" -version = "0.5.7" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-bidi 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-normalization 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "uuid 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", + "uuid 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "url" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "idna 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "user32-sys" -version = "0.1.2" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "winapi 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (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 = "uuid" -version = "0.1.18" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "winapi" -version = "0.2.6" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -603,13 +675,93 @@ dependencies = [ [[package]] name = "zip" -version = "0.1.16" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bzip2 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "flate2 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "flate2 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", "msdos_time 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "podio 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", ] +[metadata] +"checksum bitflags 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "32866f4d103c4e438b1db1158aa1b1a80ee078e5d77a59a2f906fd62a577389c" +"checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" +"checksum byteorder 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "96c8b41881888cc08af32d47ac4edd52bc7fa27fef774be47a92443756451304" +"checksum byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0fc10e8cc6b2580fda3f36eb6dc5316657f812a3df879a44a66fc9f0fdbc4855" +"checksum bzip2 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7c30a578393daf45ee6101aa043afa8d47a7e70f05032b15b88b28a7111c6a53" +"checksum bzip2-sys 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "81c91586be5d862524de53126d49c11fef83dc1a8e8034235f37372e3b2da311" +"checksum cgmath 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "75e93b3eb66e74ffb946a69ff54c6026c1399960241c843f249ea0127b96b9f6" +"checksum collision 0.5.1 (git+https://github.com/csherratt/collision-rs?rev=f80825e)" = "" +"checksum color_quant 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a475fc4af42d83d28adf72968d9bcfaf035a1a9381642d8e85d8a04957767b0d" +"checksum cookie 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0e3d6405328b6edb412158b3b7710e2634e23f3614b9bb1c412df7952489a626" +"checksum deque 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1614659040e711785ed8ea24219140654da1729f3ec8a47a9719d041112fe7bf" +"checksum enum_primitive 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f79eff5be92a4d7d5bddf7daa7d650717ea71628634efe6ca7bcda85b2183c23" +"checksum flate2 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "3eeb481e957304178d2e782f2da1257f1434dfecbae883bafb61ada2a9fea3bb" +"checksum gcc 0.3.35 (registry+https://github.com/rust-lang/crates.io-index)" = "91ecd03771effb0c968fd6950b37e89476a578aaf1c70297d8e92b6516ec3312" +"checksum gdi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0912515a8ff24ba900422ecda800b52f4016a56251922d397c576bf92c690518" +"checksum gif 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "45403dbb4c5208d0e0f46e663e9df19abb84f1ab2ec8c5a830eafea41ad10df3" +"checksum gl_generator 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "37905b2d6c7ade3f675d4b03cc038709c7868b938c5950f05a4a03f299b21011" +"checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" +"checksum hpack 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3d2da7d3a34cf6406d9d700111b8eafafe9a251de41ae71d8052748259343b58" +"checksum httparse 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "46534074dbb80b070d60a5cb8ecadd8963a00a438ae1a95268850a7ef73b67ae" +"checksum hyper 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bb0f4d00bb781e559b6e66ae4b5479df0fdf9ab15949f52fa2f1f5de16d4cc07" +"checksum idna 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1053236e00ce4f668aeca4a769a09b3bf5a682d802abd6f3cb39374f6b162c11" +"checksum image 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "439bfcbcf8a0ef6064c53d4d4c03e5df549415c2088e381ef0d7c8225c47bd1a" +"checksum inflate 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e7e0062d2dc2f17d2f13750d95316ae8a2ff909af0fda957084f5defd87c43bb" +"checksum itoa 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ae3088ea4baeceb0284ee9eea42f591226e6beaecf65373e41b38d95a1b8e7a1" +"checksum jpeg-decoder 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "70be4c5ed7c80bb403fb28d95d30dd97ccf76829e943ae2350037fd6cd6961b6" +"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +"checksum khronos_api 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "09c9d3760673c427d46f91a0350f0a84a52e6bc5a84adf26dc610b6c52436630" +"checksum language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" +"checksum lazy_static 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "cf186d1a8aa5f5bee5fd662bc9c1b949e0259e1bcc379d1f006847b0080c7417" +"checksum lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "49247ec2a285bb3dcb23cbd9c35193c025e7251bfce77c1d5da97e6362dffe7f" +"checksum libc 0.2.15 (registry+https://github.com/rust-lang/crates.io-index)" = "23e3757828fa702a20072c37ff47938e9dd331b92fac6e223d26d4b7a55f7ee2" +"checksum libressl-pnacl-sys 2.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "cbc058951ab6a3ef35ca16462d7642c4867e6403520811f28537a4e2f2db3e71" +"checksum log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ab83497bf8bf4ed2a74259c1c802351fcd67a65baa86394b6ba73c36f4838054" +"checksum lzw 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cba82344432e19bcb98fa21c5a6e78f42a06252b4744e2e9162ae98b3a01ee92" +"checksum matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "15305656809ce5a4805b1ff2946892810992197ce1270ff79baded852187942e" +"checksum mime 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b5c93a4bd787ddc6e7833c519b73a50883deb5863d76d9b71eb8216fb7f94e66" +"checksum miniz-sys 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "9d1f4d337a01c32e1f2122510fed46393d53ca35a7f429cb0450abaedfa3ed54" +"checksum msdos_time 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "c04b68cc63a8480fb2550343695f7be72effdec953a9d4508161c3e69041c7d8" +"checksum num 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "5a9699207fab8b02bd0e56f8f06fee3f26d640303130de548898b4c9704f6d01" +"checksum num-bigint 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "88b14378471f7c2adc5262f05b4701ef53e8da376453a8d8fee48e51db745e49" +"checksum num-complex 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "f0c78e054dd19c3fd03419ade63fa661e9c49bb890ce3beb4eee5b7baf93f92f" +"checksum num-integer 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "fb24d9bfb3f222010df27995441ded1e954f8f69cd35021f6bef02ca9552fb92" +"checksum num-iter 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "287a1c9969a847055e1122ec0ea7a5c5d6f72aad97934e131c83d5c08ab4e45c" +"checksum num-rational 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "54ff603b8334a72fbb27fe66948aac0abaaa40231b3cecd189e76162f6f38aaf" +"checksum num-traits 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "8359ea48994f253fa958b5b90b013728b06f54872e5a58bce39540fcdd0f2527" +"checksum num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "cee7e88156f3f9e19bdd598f8d6c9db7bf4078f99f8381f43a55b09648d1a6e3" +"checksum openssl 0.7.14 (registry+https://github.com/rust-lang/crates.io-index)" = "c4117b6244aac42ed0150a6019b4d953d28247c5dd6ae6f46ae469b5f2318733" +"checksum openssl-sys 0.7.17 (registry+https://github.com/rust-lang/crates.io-index)" = "89c47ee94c352eea9ddaf8e364be7f978a3bb6d66d73176572484238dd5a5c3f" +"checksum openssl-sys-extras 0.7.14 (registry+https://github.com/rust-lang/crates.io-index)" = "11c5e1dba7d3d03d80f045bf0d60111dc69213b67651e7c889527a3badabb9fa" +"checksum pkg-config 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8cee804ecc7eaf201a4a207241472cc870e825206f6c031e3ee2a72fa425f2fa" +"checksum pnacl-build-helper 1.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "61c9231d31aea845007443d62fcbb58bb6949ab9c18081ee1e09920e0cf1118b" +"checksum png 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "668644d06046819b75098c990e291c4cbadb4a2d1b2424211bf1321005ec764a" +"checksum podio 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e5422a1ee1bc57cc47ae717b0137314258138f38fd5f3cea083f43a9725383a0" +"checksum rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "2791d88c6defac799c3f20d74f094ca33b9332612d9aef9078519c82e4fe04a5" +"checksum rayon 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8e501871917624668fe601ad12a730450414f9b0b64722a898b040ce3ae1b0fa" +"checksum rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)" = "6159e4e6e559c81bd706afe9c8fd68f547d3e851ce12e76b1de7914bab61691b" +"checksum rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "c5f5376ea5e30ce23c03eb77cbe4962b988deead10910c372b226388b594c084" +"checksum sdl2 0.16.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e7f18f5878c752274f527804bdd6698c38d9b20317a0a56db77d84032498941e" +"checksum sdl2-sys 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "48bd067cbfaa00649afd649add954e8221af03815e2e261fab6caf274d77c4d1" +"checksum semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)" = "d4f410fedcf71af0345d7607d246e7ad15faaadd49d240ee3b24e5dc21a820ac" +"checksum serde 0.7.15 (registry+https://github.com/rust-lang/crates.io-index)" = "1b0e0732aa8ec4267f61815a396a942ba3525062e3bd5520aa8419927cfc0a92" +"checksum serde_json 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b22e8a0554f31cb0f501e027de07b253553b308124f61c57598b9678dba35c0b" +"checksum solicit 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "172382bac9424588d7840732b250faeeef88942e37b6e35317dce98cafdd75b2" +"checksum tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "87974a6f5c1dfb344d733055601650059a3363de2a6104819293baff662132d6" +"checksum time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "3c7ec6d62a20df54e07ab3b78b9a3932972f4b7981de295563686849eb3989af" +"checksum traitobject 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "07eaeb7689bb7fca7ce15628319635758eda769fed481ecfe6686ddef2600616" +"checksum typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887" +"checksum unicase 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "13a5906ca2b98c799f4b1ab4557b76367ebd6ae5ef14930ec841c74aed5f3764" +"checksum unicode-bidi 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c1f7ceb96afdfeedee42bade65a0d585a6a0106f681b6749c8ff4daa8df30b3f" +"checksum unicode-normalization 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "26643a2f83bac55f1976fb716c10234485f9202dcd65cfbdf9da49867b271172" +"checksum url 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4a3440c1ed62af4a2aee71c6fb78ef32ddcb75cfa24bf42f45e07c02b6d6a2f6" +"checksum url 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "afe9ec54bc4db14bc8744b7fed060d785ac756791450959b2248443319d5b119" +"checksum user32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ef4711d107b21b410a3a974b1204d9accc8b10dad75d8324b5d755de1617d47" +"checksum uuid 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "885acc3b17fdef6230d1f7765dff1106dfd5e75a93c2f26459fbf600ed6dcc14" +"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" +"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" +"checksum xml-rs 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0d7c34f934fa02d71d33e03f2eceecd0adfe881d9acddbbd908318e12d449ebf" +"checksum zip 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)" = "3ceb33a75b3d0608942302eed325b59d2c3ed777cc6c01627ae14e5697c6a31c" diff --git a/src/chunk_builder.rs b/src/chunk_builder.rs index 3a9df74..e9b62b2 100644 --- a/src/chunk_builder.rs +++ b/src/chunk_builder.rs @@ -2,7 +2,6 @@ use std::thread; use std::sync::mpsc; use std::sync::{Arc, RwLock}; -use std::io::Write; use world; use world::block; use render; @@ -138,9 +137,9 @@ fn build_func(id: usize, models: Arc>, work_recv: mpsc::R let block = snapshot.get_block(x, y, z); let mat = block.get_material(); if !mat.renderable { - // Use one step of the rng so that - // if a block is placed in an empty - // location is variant doesn't change + // Use one step of the rng so that + // if a block is placed in an empty + // location is variant doesn't change rng.next_u32(); continue; } @@ -259,13 +258,11 @@ fn flood_fill(snapshot: &world::Snapshot, visited: &mut Set, x: i32, y: i32, z: touched } -#[derive(Clone, Copy)] +#[derive(Clone, Copy, Default)] pub struct CullInfo(u64); impl CullInfo { - pub fn new() -> CullInfo { - CullInfo(0) - } + pub fn new() -> CullInfo { Default::default() } pub fn all_vis() -> CullInfo { CullInfo(0xFFFFFFFFFFFFFFFF) diff --git a/src/console/mod.rs b/src/console/mod.rs index 9bea549..d3703d9 100644 --- a/src/console/mod.rs +++ b/src/console/mod.rs @@ -99,6 +99,7 @@ pub trait Var { fn can_serialize(&self) -> bool; } +#[derive(Default)] pub struct Vars { names: HashMap, vars: HashMap<&'static str, Box>, @@ -106,13 +107,7 @@ pub struct Vars { } impl Vars { - pub fn new() -> Vars { - Vars { - names: HashMap::new(), - vars: HashMap::new(), - var_values: HashMap::new(), - } - } + pub fn new() -> Vars { Default::default() } pub fn register(&mut self, var: CVar) where CVar: Var @@ -125,7 +120,7 @@ impl Vars { self.vars.insert(var.name, Box::new(var)); } - pub fn get<'a, T: Sized + Any>(&'a self, var: CVar) -> Ref<'a, T> + pub fn get(&self, var: CVar) -> Ref where CVar: Var { // Should never fail @@ -152,7 +147,7 @@ impl Vars { let (name, arg) = (&parts[0], &parts[1]); if let Some(var_name) = self.names.get(name) { let var = self.vars.get(var_name).unwrap(); - let val = var.deserialize(&arg); + let val = var.deserialize(arg); if var.can_serialize() { self.var_values.insert(var_name, RefCell::new(val)); } diff --git a/src/ecs/mod.rs b/src/ecs/mod.rs index f53d0b7..e91a347 100644 --- a/src/ecs/mod.rs +++ b/src/ecs/mod.rs @@ -424,7 +424,7 @@ impl Manager { None => return None, }; let set = match self.entities.get(entity.id).as_ref() { - Some(ref val) => if val.1 == entity.generation { &val.0 } else { return None }, + Some(val) => if val.1 == entity.generation { &val.0 } else { return None }, None => return None, }; if !set.as_ref().map_or(false, |v| v.components.get(key.id)) { @@ -448,7 +448,7 @@ impl Manager { None => return None, }; let set = match self.entities.get(entity.id).as_ref() { - Some(ref val) => if val.1 == entity.generation { &val.0 } else { return None }, + Some(val) => if val.1 == entity.generation { &val.0 } else { return None }, None => return None, }; if !set.as_ref().map_or(false, |v| v.components.get(key.id)) { diff --git a/src/entity/mod.rs b/src/entity/mod.rs index 8dd5533..402857e 100644 --- a/src/entity/mod.rs +++ b/src/entity/mod.rs @@ -125,16 +125,13 @@ impl TargetRotation { } } +#[derive(Default)] pub struct Gravity { pub on_ground: bool, } impl Gravity { - pub fn new() -> Gravity { - Gravity { - on_ground: false, - } - } + pub fn new() -> Gravity { Default::default() } } pub struct Bounds { @@ -149,28 +146,21 @@ impl Bounds { } } +#[derive(Default)] pub struct GameInfo { pub delta: f64, } impl GameInfo { - pub fn new() -> GameInfo { - GameInfo { - delta: 0.0, - } - } + pub fn new() -> GameInfo { Default::default() } } +#[derive(Default)] pub struct Light { pub block_light: f32, pub sky_light: f32, } impl Light { - pub fn new() -> Light { - Light { - block_light: 0.0, - sky_light: 0.0, - } - } + pub fn new() -> Light { Default::default() } } diff --git a/src/entity/player.rs b/src/entity/player.rs index d3117a9..3c23301 100644 --- a/src/entity/player.rs +++ b/src/entity/player.rs @@ -302,7 +302,7 @@ impl ecs::System for PlayerRenderer { player_model.dirty = false; let skin = if let Some(url) = player_model.skin_url.as_ref() { - renderer.get_skin(renderer.get_textures_ref(), &url) + renderer.get_skin(renderer.get_textures_ref(), url) } else { render::Renderer::get_texture(renderer.get_textures_ref(), "entity/steve") }; @@ -432,12 +432,13 @@ impl ecs::System for PlayerRenderer { if let Some(model) = player_model.model.take() { renderer.model.remove_model(model); if let Some(url) = player_model.skin_url.as_ref() { - renderer.get_textures_ref().read().unwrap().release_skin(&url); + renderer.get_textures_ref().read().unwrap().release_skin(url); } } } } +#[derive(Default)] pub struct PlayerMovement { pub flying: bool, pub did_touch_ground: bool, @@ -445,13 +446,7 @@ pub struct PlayerMovement { } impl PlayerMovement { - pub fn new() -> PlayerMovement { - PlayerMovement { - flying: false, - did_touch_ground: false, - pressed_keys: HashMap::with_hasher(BuildHasherDefault::default()), - } - } + pub fn new() -> PlayerMovement { Default::default() } fn calculate_movement(&self, player_yaw: f64) -> (f64, f64) { use std::f64::consts::PI; @@ -463,13 +458,11 @@ impl PlayerMovement { yaw += PI; } } - let mut change = 0.0; - if self.is_key_pressed(Stevenkey::Left) { - change = (PI / 2.0) / (forward.abs() + 1.0); - } - if self.is_key_pressed(Stevenkey::Right) { - change = -(PI / 2.0) / (forward.abs() + 1.0); - } + let change = if self.is_key_pressed(Stevenkey::Left) { + (PI / 2.0) / (forward.abs() + 1.0) + } else if self.is_key_pressed(Stevenkey::Right) { + -(PI / 2.0) / (forward.abs() + 1.0) + } else { 0.0 }; if self.is_key_pressed(Stevenkey::Left) || self.is_key_pressed(Stevenkey::Right) { forward = 1.0; } @@ -551,10 +544,9 @@ impl ecs::System for MovementHandler { if world.is_chunk_loaded((position.position.x as i32) >> 4, (position.position.z as i32) >> 4) { let (forward, yaw) = movement.calculate_movement(rotation.yaw); - let mut speed = 0.21585; - if movement.is_key_pressed(Stevenkey::Sprint) { - speed = 0.2806; - } + let mut speed = if movement.is_key_pressed(Stevenkey::Sprint) { + 0.2806 + } else { 0.21585 }; if movement.flying { speed *= 2.5; diff --git a/src/format.rs b/src/format.rs index 1b1bad9..e75f3ec 100644 --- a/src/format.rs +++ b/src/format.rs @@ -33,7 +33,7 @@ impl Component { convert_legacy(&mut component); }, } - return component; + component } pub fn from_value(v: &serde_json::Value) -> Self { diff --git a/src/gl/mod.rs b/src/gl/mod.rs index 5e5c4cc..e13d0da 100644 --- a/src/gl/mod.rs +++ b/src/gl/mod.rs @@ -497,7 +497,8 @@ impl Program { pub fn attribute_location(&self, name: &str) -> Option { let a = unsafe { - gl::GetAttribLocation(self.0, ffi::CString::new(name).unwrap().as_ptr()) + let name_c = ffi::CString::new(name).unwrap(); + gl::GetAttribLocation(self.0, name_c.as_ptr()) }; if a != -1 { Some(Attribute(a)) @@ -524,9 +525,10 @@ impl Shader { pub fn set_source(&self, src: &str) { unsafe { + let src_c = ffi::CString::new(src).unwrap(); gl::ShaderSource(self.0, 1, - &ffi::CString::new(src).unwrap().as_ptr(), + &src_c.as_ptr(), ptr::null()); } } @@ -611,7 +613,6 @@ impl Uniform { } pub fn set_matrix4_multi(&self, m: &[::cgmath::Matrix4]) { - use cgmath::Matrix; unsafe { gl::UniformMatrix4fv(self.0, m.len() as i32, false as u8, m.as_ptr() as *const _); // TODO: Most likely isn't safe } @@ -889,7 +890,8 @@ pub fn draw_buffers(bufs: &[Attachment]) { pub fn bind_frag_data_location(p: &Program, cn: u32, name: &str) { unsafe { - gl::BindFragDataLocation(p.0, cn, ffi::CString::new(name).unwrap().as_ptr()); + let name_c = ffi::CString::new(name).unwrap(); + gl::BindFragDataLocation(p.0, cn, name_c.as_ptr()); } } diff --git a/src/main.rs b/src/main.rs index 1881365..f4aa930 100644 --- a/src/main.rs +++ b/src/main.rs @@ -276,7 +276,7 @@ fn main() { let frame_time = time::now() - now; let sleep_interval = time::Duration::milliseconds(1000 / fps_cap); if frame_time < sleep_interval { - thread::sleep_ms((sleep_interval - frame_time).num_milliseconds() as u32); + thread::sleep((sleep_interval - frame_time).to_std().unwrap()); } } window.gl_swap_window(); diff --git a/src/model/liquid.rs b/src/model/liquid.rs index 407d257..6224d32 100644 --- a/src/model/liquid.rs +++ b/src/model/liquid.rs @@ -64,14 +64,14 @@ pub fn render_liquid(textures: Arc>,lav (0.0, _) => ((16.0 / 8.0) * (bl as f32)) as i32, (_, _) => ((16.0 / 8.0) * (br as f32)) as i32, }; - vert.y = (height as f32)/16.0 + (y as f32); + vert.y = (height as f32)/16.0 + (y as f32); } vert.x += x as f32; vert.z += z as f32; let (bl, sl) = super::calculate_light( - &snapshot, + snapshot, x, y, z, vert.x as f64, vert.y as f64, diff --git a/src/model/mod.rs b/src/model/mod.rs index 4b2b954..bfd5f23 100644 --- a/src/model/mod.rs +++ b/src/model/mod.rs @@ -108,7 +108,7 @@ impl Factory { let ok = Self::eval_rules(block, &rule.rules); if ok { if res.is_some() { - res.as_mut().unwrap().join(&rule.apply.choose_model(rng)); + res.as_mut().unwrap().join(rule.apply.choose_model(rng)); } else { res = Some(rule.apply.choose_model(rng).clone()); } @@ -143,7 +143,7 @@ impl Factory { } }, Rule::Match(ref key, ref val) => { - if !block.match_multipart(&key, &val) { + if !block.match_multipart(key, val) { return false; } } @@ -261,10 +261,8 @@ impl Factory { variants.models.push(self.process_model(mdl)); } } - } else { - if let Some(mdl) = self.parse_block_state_variant(plugin, v) { - variants.models.push(self.process_model(mdl)); - } + } else if let Some(mdl) = self.parse_block_state_variant(plugin, v) { + variants.models.push(self.process_model(mdl)); } variants } @@ -589,8 +587,8 @@ impl Factory { v.z = z*c + x*s; if r.rescale { - v.x = v.x * ci; - v.z = v.z * ci; + v.x *= ci; + v.z *= ci; } }, "x" => { @@ -602,8 +600,8 @@ impl Factory { v.y = y*c + z*s; if r.rescale { - v.z = v.z * ci; - v.y = v.y * ci; + v.z *= ci; + v.y *= ci; } }, "z" => { @@ -615,8 +613,8 @@ impl Factory { v.y = y*c + x*s; if r.rescale { - v.x = v.x * ci; - v.y = v.y * ci; + v.x *= ci; + v.y *= ci; } }, _ => {} @@ -899,7 +897,7 @@ impl Model { vert.b = cb; let (bl, sl) = calculate_light( - &snapshot, + snapshot, x, y, z, vert.x as f64, vert.y as f64, diff --git a/src/nbt/mod.rs b/src/nbt/mod.rs index ecd9495..0ded16d 100644 --- a/src/nbt/mod.rs +++ b/src/nbt/mod.rs @@ -14,7 +14,7 @@ use std::collections::HashMap; use std::io; -use std::io::{Read, Write}; +use std::io::Read; use super::protocol::Serializable; use super::protocol; diff --git a/src/render/glsl.rs b/src/render/glsl.rs index 1cafbbd..28cfcf7 100644 --- a/src/render/glsl.rs +++ b/src/render/glsl.rs @@ -14,14 +14,13 @@ use std::collections::HashMap; +#[derive(Default)] pub struct Registry { shaders: HashMap, } impl Registry { - pub fn new() -> Registry { - Registry { shaders: HashMap::new() } - } + pub fn new() -> Registry { Default::default() } pub fn register(&mut self, name: &str, source: &str) { if self.shaders.contains_key(name) { @@ -52,10 +51,10 @@ impl Registry { for line in src.lines() { if line.starts_with("#include ") { let inc = line["#include ".len()..].trim(); - self.get_internal(out, &inc); + self.get_internal(out, inc); continue; } - out.push_str(&line); + out.push_str(line); out.push_str("\n"); } } diff --git a/src/render/mod.rs b/src/render/mod.rs index e823e27..9644d5d 100644 --- a/src/render/mod.rs +++ b/src/render/mod.rs @@ -89,18 +89,14 @@ pub struct Renderer { skin_reply: mpsc::Receiver<(String, Option)>, } +#[derive(Default)] pub struct ChunkBuffer { solid: Option, trans: Option, } impl ChunkBuffer { - pub fn new() -> ChunkBuffer { - ChunkBuffer { - solid: None, - trans: None, - } - } + pub fn new() -> ChunkBuffer { Default::default() } } struct ChunkRenderInfo { @@ -156,7 +152,6 @@ init_shader! { impl Renderer { pub fn new(res: Arc>) -> Renderer { - use cgmath::Matrix; let version = { res.read().unwrap().version() }; diff --git a/src/render/model.rs b/src/render/model.rs index afa5eb7..293fe67 100644 --- a/src/render/model.rs +++ b/src/render/model.rs @@ -186,7 +186,7 @@ impl Manager { vert.texture = if vert.texture.version == version { vert.texture.clone() } else { - let mut new = super::Renderer::get_texture(&textures, &vert.texture.name); + let mut new = super::Renderer::get_texture(textures, &vert.texture.name); new.rel_x = vert.texture.rel_x; new.rel_y = vert.texture.rel_y; new.rel_width = vert.texture.rel_width; @@ -358,8 +358,8 @@ pub struct FormatState<'a> { impl <'a> FormatState<'a> { pub fn build(&mut self, c: &Component, color: format::Color) { - match c { - &format::Component::Text(ref txt) => { + match *c { + format::Component::Text(ref txt) => { let col = FormatState::get_color(&txt.modifier, color); self.append_text(&txt.text, col); let modi = &txt.modifier; diff --git a/src/screen/edit_server.rs b/src/screen/edit_server.rs index 04035b1..683450f 100644 --- a/src/screen/edit_server.rs +++ b/src/screen/edit_server.rs @@ -67,7 +67,7 @@ impl EditServerEntry { .as_array_mut() .unwrap(); if let Some(index) = index { - *servers.iter_mut().nth(index).unwrap() = new_entry; + *servers.get_mut(index).unwrap() = new_entry; } else { servers.push(new_entry); } diff --git a/src/screen/mod.rs b/src/screen/mod.rs index 6f59014..e3abc31 100644 --- a/src/screen/mod.rs +++ b/src/screen/mod.rs @@ -58,18 +58,14 @@ struct ScreenInfo { active: bool, } +#[derive(Default)] pub struct ScreenSystem { screens: Vec, remove_queue: Vec, } impl ScreenSystem { - pub fn new() -> ScreenSystem { - ScreenSystem { - screens: Vec::new(), - remove_queue: Vec::new(), - } - } + pub fn new() -> ScreenSystem { Default::default() } pub fn add_screen(&mut self, screen: Box) { self.screens.push(ScreenInfo { diff --git a/src/screen/server_list.rs b/src/screen/server_list.rs index 918bf8e..9c073d2 100644 --- a/src/screen/server_list.rs +++ b/src/screen/server_list.rs @@ -107,7 +107,7 @@ impl ServerList { let mut tex = renderer.get_textures_ref().write().unwrap(); for server in &mut elements.servers { if let Some(ref icon) = server.icon_texture { - tex.remove_dynamic(&icon); + tex.remove_dynamic(icon); } } } @@ -426,7 +426,7 @@ impl super::Screen for ServerList { let mut tex = renderer.get_textures_ref().write().unwrap(); for server in &mut elements.servers { if let Some(ref icon) = server.icon_texture { - tex.remove_dynamic(&icon); + tex.remove_dynamic(icon); } } } diff --git a/src/server/mod.rs b/src/server/mod.rs index a3e9709..2475a61 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -28,7 +28,6 @@ use settings::Stevenkey; use ecs; use entity; use cgmath::{self, Point}; -use collision::Aabb; use types::Gamemode; use shared::{Axis, Position}; use format; @@ -432,9 +431,9 @@ impl Server { self.world_time_target = (24000.0 + self.world_time_target) % 24000.0; let mut diff = self.world_time_target - self.world_time; if diff < -12000.0 { - diff = 24000.0 + diff + diff += 24000.0 } else if diff > 12000.0 { - diff = diff - 24000.0 + diff -= 24000.0 } self.world_time += diff * (1.5 / 60.0) * delta; self.world_time = (24000.0 + self.world_time) % 24000.0; @@ -721,22 +720,19 @@ impl Server { )); }, Some(nbt) => { - match block_update.action { - 9 => { - use format; - let line1 = format::Component::from_string(nbt.1.get("Text1").unwrap().as_string().unwrap()); - let line2 = format::Component::from_string(nbt.1.get("Text2").unwrap().as_string().unwrap()); - let line3 = format::Component::from_string(nbt.1.get("Text3").unwrap().as_string().unwrap()); - let line4 = format::Component::from_string(nbt.1.get("Text4").unwrap().as_string().unwrap()); - self.world.add_block_entity_action(world::BlockEntityAction::UpdateSignText( - block_update.location, - line1, - line2, - line3, - line4, - )); - }, - _ => {} // Ignore it + if block_update.action == 9 { + use format; + let line1 = format::Component::from_string(nbt.1.get("Text1").unwrap().as_string().unwrap()); + let line2 = format::Component::from_string(nbt.1.get("Text2").unwrap().as_string().unwrap()); + let line3 = format::Component::from_string(nbt.1.get("Text3").unwrap().as_string().unwrap()); + let line4 = format::Component::from_string(nbt.1.get("Text4").unwrap().as_string().unwrap()); + self.world.add_block_entity_action(world::BlockEntityAction::UpdateSignText( + block_update.location, + line1, + line2, + line3, + line4, + )); } } } @@ -833,26 +829,23 @@ impl Server { chunk_data.data.data ).unwrap(); for optional_block_entity in chunk_data.block_entities.data { - match optional_block_entity { - Some(block_entity) => { - let x = block_entity.1.get("x").unwrap().as_int().unwrap(); - let y = block_entity.1.get("y").unwrap().as_int().unwrap(); - let z = block_entity.1.get("z").unwrap().as_int().unwrap(); - let tile_id = block_entity.1.get("id").unwrap().as_string().unwrap(); - let action; - match tile_id { - // Fake a sign update - "Sign" => action = 9, - // Not something we care about, so break the loop - _ => continue, - } - self.on_block_entity_update(packet::play::clientbound::UpdateBlockEntity { - location: Position::new(x, y, z), - action: action, - nbt: Some(block_entity.clone()), - }); - }, - None => {} // Ignore + if let Some(block_entity) = optional_block_entity { + let x = block_entity.1.get("x").unwrap().as_int().unwrap(); + let y = block_entity.1.get("y").unwrap().as_int().unwrap(); + let z = block_entity.1.get("z").unwrap().as_int().unwrap(); + let tile_id = block_entity.1.get("id").unwrap().as_string().unwrap(); + let action; + match tile_id { + // Fake a sign update + "Sign" => action = 9, + // Not something we care about, so break the loop + _ => continue, + } + self.on_block_entity_update(packet::play::clientbound::UpdateBlockEntity { + location: Position::new(x, y, z), + action: action, + nbt: Some(block_entity.clone()), + }); } } } diff --git a/src/server/target.rs b/src/server/target.rs index 75a6a4e..832a972 100644 --- a/src/server/target.rs +++ b/src/server/target.rs @@ -237,7 +237,7 @@ pub fn trace_ray(world: &world::World, max: f64, s: cgmath::Vector3, let mut z = s.z.floor() as i32; loop { - let (hit, ret) = collide_func(&world, Position::new(x, y, z), s, d); + let (hit, ret) = collide_func(world, Position::new(x, y, z), s, d); if hit { return ret; } @@ -253,18 +253,16 @@ pub fn trace_ray(world: &world::World, max: f64, s: cgmath::Vector3, z += d.z.signum() as i32; old } + } else if next_ny <= next_nz { + let old = next_ny; + next_ny = y_gen.next(); + y += d.y.signum() as i32; + old } else { - if next_ny <= next_nz { - let old = next_ny; - next_ny = y_gen.next(); - y += d.y.signum() as i32; - old - } else { - let old = next_nz; - next_nz = z_gen.next(); - z += d.z.signum() as i32; - old - } + let old = next_nz; + next_nz = z_gen.next(); + z += d.z.signum() as i32; + old }; if next_n > max { break; diff --git a/src/types/bit/set.rs b/src/types/bit/set.rs index 8c9c221..894d936 100644 --- a/src/types/bit/set.rs +++ b/src/types/bit/set.rs @@ -68,7 +68,7 @@ impl Set { pub fn or(&mut self, other: &Set) { for (a, b) in self.data.iter_mut().zip(&other.data) { - *a = (*a) | *b; + *a |= *b; } } } diff --git a/src/types/metadata.rs b/src/types/metadata.rs index e5c8040..0cf30be 100644 --- a/src/types/metadata.rs +++ b/src/types/metadata.rs @@ -15,7 +15,6 @@ use std::collections::HashMap; use std::marker::PhantomData; use std::io; -use std::io::Write; use std::fmt; use protocol; use protocol::Serializable; diff --git a/src/ui/mod.rs b/src/ui/mod.rs index 1f866af..f46aa3f 100644 --- a/src/ui/mod.rs +++ b/src/ui/mod.rs @@ -237,7 +237,7 @@ macro_rules! define_elements { match *self { $( WeakElement::$name(ref inner) => { - inner.upgrade().map(|v| Element::$name(v)) + inner.upgrade().map(Element::$name) }, )* } @@ -1021,7 +1021,7 @@ impl UIElement for Formatted { offset: 0.0, text: Vec::new(), max_width: self.max_width, - renderer: &renderer, + renderer: renderer, }; state.build(&self.text, format::Color::White); self.text_elements = state.text; @@ -1031,7 +1031,7 @@ impl UIElement for Formatted { if self.needs_rebuild { e.force_rebuild(); } - let r = Container::compute_draw_region(e, sw, sh, &r); + let r = Container::compute_draw_region(e, sw, sh, r); let data = e.draw(renderer, &r, sw, sh, width, height, delta); self.data.extend_from_slice(&data); } @@ -1082,7 +1082,7 @@ impl Formatted { max_width: max_width, renderer: renderer, }; - state.build(&text, format::Color::White); + state.build(text, format::Color::White); (state.width + 2.0, (state.lines + 1) as f64 * 18.0) } } @@ -1105,8 +1105,8 @@ impl <'a> ElementHolder for FormatState<'a> { impl <'a> FormatState<'a> { fn build(&mut self, c: &format::Component, color: format::Color) { - match c { - &format::Component::Text(ref txt) => { + match *c { + format::Component::Text(ref txt) => { let col = FormatState::get_color(&txt.modifier, color); self.append_text(&txt.text, col); let modi = &txt.modifier; diff --git a/src/world/mod.rs b/src/world/mod.rs index b4a271e..5893e01 100644 --- a/src/world/mod.rs +++ b/src/world/mod.rs @@ -32,6 +32,7 @@ use format; pub mod biome; mod storage; +#[derive(Default)] pub struct World { chunks: HashMap>, @@ -76,14 +77,7 @@ struct LightUpdate { } impl World { - pub fn new() -> World { - World { - chunks: HashMap::with_hasher(BuildHasherDefault::default()), - render_list: vec![], - light_updates: VecDeque::new(), - block_entity_actions: VecDeque::new(), - } - } + pub fn new() -> World { Default::default() } pub fn is_chunk_loaded(&self, x: i32, z: i32) -> bool { self.chunks.contains_key(&CPos(x, z)) @@ -151,7 +145,7 @@ impl World { pub fn get_block(&self, pos: Position) -> block::Block { match self.chunks.get(&CPos(pos.x >> 4, pos.z >> 4)) { - Some(ref chunk) => chunk.get_block(pos.x & 0xF, pos.y, pos.z & 0xF), + Some(chunk) => chunk.get_block(pos.x & 0xF, pos.y, pos.z & 0xF), None => block::Missing{}, } } @@ -164,7 +158,7 @@ impl World { pub fn get_block_light(&self, pos: Position) -> u8 { match self.chunks.get(&CPos(pos.x >> 4, pos.z >> 4)) { - Some(ref chunk) => chunk.get_block_light(pos.x & 0xF, pos.y, pos.z & 0xF), + Some(chunk) => chunk.get_block_light(pos.x & 0xF, pos.y, pos.z & 0xF), None => 0, } } @@ -177,7 +171,7 @@ impl World { pub fn get_sky_light(&self, pos: Position) -> u8 { match self.chunks.get(&CPos(pos.x >> 4, pos.z >> 4)) { - Some(ref chunk) => chunk.get_sky_light(pos.x & 0xF, pos.y, pos.z & 0xF), + Some(chunk) => chunk.get_sky_light(pos.x & 0xF, pos.y, pos.z & 0xF), None => 15, } } @@ -861,9 +855,8 @@ impl Chunk { .all(|v| v.is_none()); self.sections[s_idx] = Some(Section::new(s_idx as u8, fill_sky)); } - match self.sections[s_idx].as_mut() { - Some(sec) => sec.set_block_light(x, y & 0xF, z, light), - None => {}, + if let Some(sec) = self.sections[s_idx].as_mut() { + sec.set_block_light(x, y & 0xF, z, light) } } @@ -893,9 +886,8 @@ impl Chunk { .all(|v| v.is_none()); self.sections[s_idx] = Some(Section::new(s_idx as u8, fill_sky)); } - match self.sections[s_idx as usize].as_mut() { - Some(sec) => sec.set_sky_light(x, y & 0xF, z, light), - None => {}, + if let Some(sec) = self.sections[s_idx as usize].as_mut() { + sec.set_sky_light(x, y & 0xF, z, light) } }