From 411e4f69a6350cff620ba18a5025b88318ef5413 Mon Sep 17 00:00:00 2001 From: ice_iix Date: Sun, 4 Nov 2018 12:35:06 -0800 Subject: [PATCH] Remove unnecessary 'extern crate's in Rust 2018 edition, import macros https://rust-lang-nursery.github.io/edition-guide/print.html#no-more-extern-crate https://rust-lang-nursery.github.io/edition-guide/rust-2018/macros/macro-changes.html https://github.com/iceiix/steven/pull/13#issuecomment-435702507 --- blocks/src/lib.rs | 5 +---- gl/build.rs | 3 --- src/main.rs | 23 +---------------------- src/model/mod.rs | 1 + src/protocol/mojang.rs | 2 +- src/render/mod.rs | 1 + src/server/mod.rs | 1 + src/world/biome.rs | 1 + 8 files changed, 7 insertions(+), 30 deletions(-) diff --git a/blocks/src/lib.rs b/blocks/src/lib.rs index 26761d1..3fef4c7 100644 --- a/blocks/src/lib.rs +++ b/blocks/src/lib.rs @@ -1,15 +1,12 @@ #![recursion_limit="300"] -extern crate cgmath; -extern crate collision; -#[macro_use] -extern crate lazy_static; extern crate steven_shared as shared; use crate::shared::{Axis, Direction, Position}; use collision::Aabb3; use cgmath::Point3; +use lazy_static::lazy_static; pub mod material; pub use self::material::Material; diff --git a/gl/build.rs b/gl/build.rs index 3ce9610..4cfe3d6 100644 --- a/gl/build.rs +++ b/gl/build.rs @@ -1,6 +1,3 @@ -extern crate gl_generator; -extern crate khronos_api; - use std::env; use std::fs::File; use std::io::BufWriter; diff --git a/src/main.rs b/src/main.rs index 2a9efaf..7e7fd55 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,29 +14,8 @@ #![recursion_limit="300"] -extern crate sdl2; -extern crate zip; -extern crate image; use std::time::{Instant, Duration}; -extern crate byteorder; -#[macro_use] -extern crate serde_json; -extern crate aes; -extern crate cfb8; -extern crate sha1; -extern crate reqwest; -extern crate flate2; -extern crate rand; -extern crate hex; -extern crate base64; -extern crate cgmath; -#[macro_use] -extern crate log; -#[macro_use] -extern crate lazy_static; -extern crate collision; -extern crate rsa_public_encrypt_pkcs1; -pub extern crate steven_blocks; +use log::info; extern crate steven_shared as shared; #[macro_use] diff --git a/src/model/mod.rs b/src/model/mod.rs index 08cc4b3..de61397 100644 --- a/src/model/mod.rs +++ b/src/model/mod.rs @@ -15,6 +15,7 @@ use serde_json; use std::hash::BuildHasherDefault; use crate::types::hash::FNVHash; +use log::{error}; use rand::Rng; use image::GenericImageView; diff --git a/src/protocol/mojang.rs b/src/protocol/mojang.rs index a0c7704..3a5f527 100644 --- a/src/protocol/mojang.rs +++ b/src/protocol/mojang.rs @@ -13,7 +13,7 @@ // limitations under the License. use sha1::{self, Digest}; -use serde_json; +use serde_json::json; use reqwest; #[derive(Clone, Debug)] diff --git a/src/render/mod.rs b/src/render/mod.rs index 9b8a5d8..0ac052b 100644 --- a/src/render/mod.rs +++ b/src/render/mod.rs @@ -32,6 +32,7 @@ use serde_json; use cgmath::prelude::*; use crate::world; use collision; +use log::{error, trace}; use std::hash::BuildHasherDefault; use crate::types::hash::FNVHash; diff --git a/src/server/mod.rs b/src/server/mod.rs index 1e46c95..a434b3b 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -32,6 +32,7 @@ use crate::types::Gamemode; use crate::shared::{Axis, Position}; use crate::format; use rsa_public_encrypt_pkcs1; +use log::{error, debug, warn}; mod sun; pub mod plugin_messages; diff --git a/src/world/biome.rs b/src/world/biome.rs index 7eb9415..0f331a5 100644 --- a/src/world/biome.rs +++ b/src/world/biome.rs @@ -1,5 +1,6 @@ use image::Rgba; +use lazy_static::lazy_static; #[derive(Clone, Copy)] pub struct Biome {