Skip to content

Commit

Permalink
Fix redundant imports on rustc 0.35.0. Fixes #175
Browse files Browse the repository at this point in the history
  • Loading branch information
iceiix committed May 31, 2019
1 parent 0fbcb19 commit 19948ff
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/chunk_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ use crate::resources;
use crate::model;
use crate::types::bit::Set;
use crate::shared::Direction;
use rand::{self, SeedableRng, Rng};
use rand_xorshift;

const NUM_WORKERS: usize = 8;

Expand Down Expand Up @@ -109,8 +111,6 @@ struct BuildReply {
}

fn build_func(id: usize, models: Arc<RwLock<model::Factory>>, work_recv: mpsc::Receiver<BuildReq>, built_send: mpsc::Sender<(usize, BuildReply)>) {
use rand::{self, SeedableRng, Rng};
use rand_xorshift;
loop {
let BuildReq {
snapshot,
Expand Down
2 changes: 1 addition & 1 deletion src/protocol/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ use serde_json;
use std_or_web::fs;
#[cfg(not(target_arch = "wasm32"))]
use reqwest;
use hex;

pub mod mojang;
pub mod forge;
Expand Down Expand Up @@ -409,7 +410,6 @@ pub struct UUID(u64, u64);

impl UUID {
pub fn from_str(s: &str) -> UUID {
use hex;
// TODO: Panics aren't the best idea here
if s.len() != 36 {
panic!("Invalid UUID format");
Expand Down
4 changes: 3 additions & 1 deletion src/render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ use std::sync::atomic::{AtomicIsize, Ordering};
use std::thread;
use std::sync::mpsc;

#[cfg(not(target_arch = "wasm32"))]
use reqwest;

const ATLAS_SIZE: usize = 1024;

// TEMP
Expand Down Expand Up @@ -843,7 +846,6 @@ impl TextureManager {

#[cfg(not(target_arch = "wasm32"))]
fn process_skins(recv: mpsc::Receiver<String>, reply: mpsc::Sender<(String, Option<image::DynamicImage>)>) {
use reqwest;
let client = reqwest::Client::new();
loop {
let hash = match recv.recv() {
Expand Down
7 changes: 2 additions & 5 deletions src/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ use crate::shared::{Axis, Position};
use crate::format;
use rsa_public_encrypt_pkcs1;
use log::{error, debug, warn};
use base64;
use serde_json;

mod sun;
pub mod plugin_messages;
Expand Down Expand Up @@ -1072,7 +1074,6 @@ impl Server {
},
Some(nbt) => {
if block_update.action == 9 {
use crate::format;
let line1 = format::Component::from_string(nbt.1.get("Text1").unwrap().as_str().unwrap());
let line2 = format::Component::from_string(nbt.1.get("Text2").unwrap().as_str().unwrap());
let line3 = format::Component::from_string(nbt.1.get("Text3").unwrap().as_str().unwrap());
Expand All @@ -1094,7 +1095,6 @@ impl Server {
}

fn on_sign_update(&mut self, mut update_sign: packet::play::clientbound::UpdateSign) {
use crate::format;
format::convert_legacy(&mut update_sign.line1);
format::convert_legacy(&mut update_sign.line2);
format::convert_legacy(&mut update_sign.line3);
Expand All @@ -1109,7 +1109,6 @@ impl Server {
}

fn on_sign_update_u16(&mut self, mut update_sign: packet::play::clientbound::UpdateSign_u16) {
use crate::format;
format::convert_legacy(&mut update_sign.line1);
format::convert_legacy(&mut update_sign.line2);
format::convert_legacy(&mut update_sign.line3);
Expand All @@ -1130,8 +1129,6 @@ impl Server {

fn on_player_info(&mut self, player_info: packet::play::clientbound::PlayerInfo) {
use crate::protocol::packet::PlayerDetail::*;
use base64;
use serde_json;
for detail in player_info.inner.players {
match detail {
Add { name, uuid, properties, display, gamemode, ping} => {
Expand Down
8 changes: 1 addition & 7 deletions src/world/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,6 @@ impl World {
}

pub fn compute_render_list(&mut self, renderer: &mut render::Renderer) {
use crate::chunk_builder;
use std::collections::VecDeque;
self.render_list.clear();

let mut valid_dirs = [false; 6];
Expand Down Expand Up @@ -587,7 +585,6 @@ impl World {
}

pub fn load_chunk18(&mut self, x: i32, z: i32, new: bool, _skylight: bool, mask: u16, data: &mut std::io::Cursor<Vec<u8>>) -> Result<(), protocol::Error> {
use std::io::Read;
use byteorder::ReadBytesExt;

let cpos = CPos(x, z);
Expand Down Expand Up @@ -705,9 +702,6 @@ impl World {
}

fn load_uncompressed_chunk17(&mut self, x: i32, z: i32, new: bool, skylight: bool, mask: u16, mask_add: u16, data: &mut std::io::Cursor<Vec<u8>>) -> Result<(), protocol::Error> {
use std::io::Read;
use crate::types::nibble;

let cpos = CPos(x, z);
{
let chunk = if new {
Expand Down Expand Up @@ -836,7 +830,7 @@ impl World {
}

pub fn load_chunk19(&mut self, x: i32, z: i32, new: bool, mask: u16, data: Vec<u8>) -> Result<(), protocol::Error> {
use std::io::{Cursor, Read};
use std::io::Cursor;
use byteorder::ReadBytesExt;
use crate::protocol::{VarInt, Serializable, LenPrefixed};

Expand Down

0 comments on commit 19948ff

Please sign in to comment.