Skip to content

Commit 19948ff

Browse files
committed
Fix redundant imports on rustc 0.35.0. Fixes #175
1 parent 0fbcb19 commit 19948ff

File tree

5 files changed

+9
-16
lines changed

5 files changed

+9
-16
lines changed

src/chunk_builder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ use crate::resources;
99
use crate::model;
1010
use crate::types::bit::Set;
1111
use crate::shared::Direction;
12+
use rand::{self, SeedableRng, Rng};
13+
use rand_xorshift;
1214

1315
const NUM_WORKERS: usize = 8;
1416

@@ -109,8 +111,6 @@ struct BuildReply {
109111
}
110112

111113
fn build_func(id: usize, models: Arc<RwLock<model::Factory>>, work_recv: mpsc::Receiver<BuildReq>, built_send: mpsc::Sender<(usize, BuildReply)>) {
112-
use rand::{self, SeedableRng, Rng};
113-
use rand_xorshift;
114114
loop {
115115
let BuildReq {
116116
snapshot,

src/protocol/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ use serde_json;
2222
use std_or_web::fs;
2323
#[cfg(not(target_arch = "wasm32"))]
2424
use reqwest;
25+
use hex;
2526

2627
pub mod mojang;
2728
pub mod forge;
@@ -409,7 +410,6 @@ pub struct UUID(u64, u64);
409410

410411
impl UUID {
411412
pub fn from_str(s: &str) -> UUID {
412-
use hex;
413413
// TODO: Panics aren't the best idea here
414414
if s.len() != 36 {
415415
panic!("Invalid UUID format");

src/render/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ use std::sync::atomic::{AtomicIsize, Ordering};
4040
use std::thread;
4141
use std::sync::mpsc;
4242

43+
#[cfg(not(target_arch = "wasm32"))]
44+
use reqwest;
45+
4346
const ATLAS_SIZE: usize = 1024;
4447

4548
// TEMP
@@ -843,7 +846,6 @@ impl TextureManager {
843846

844847
#[cfg(not(target_arch = "wasm32"))]
845848
fn process_skins(recv: mpsc::Receiver<String>, reply: mpsc::Sender<(String, Option<image::DynamicImage>)>) {
846-
use reqwest;
847849
let client = reqwest::Client::new();
848850
loop {
849851
let hash = match recv.recv() {

src/server/mod.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ use crate::shared::{Axis, Position};
3333
use crate::format;
3434
use rsa_public_encrypt_pkcs1;
3535
use log::{error, debug, warn};
36+
use base64;
37+
use serde_json;
3638

3739
mod sun;
3840
pub mod plugin_messages;
@@ -1072,7 +1074,6 @@ impl Server {
10721074
},
10731075
Some(nbt) => {
10741076
if block_update.action == 9 {
1075-
use crate::format;
10761077
let line1 = format::Component::from_string(nbt.1.get("Text1").unwrap().as_str().unwrap());
10771078
let line2 = format::Component::from_string(nbt.1.get("Text2").unwrap().as_str().unwrap());
10781079
let line3 = format::Component::from_string(nbt.1.get("Text3").unwrap().as_str().unwrap());
@@ -1094,7 +1095,6 @@ impl Server {
10941095
}
10951096

10961097
fn on_sign_update(&mut self, mut update_sign: packet::play::clientbound::UpdateSign) {
1097-
use crate::format;
10981098
format::convert_legacy(&mut update_sign.line1);
10991099
format::convert_legacy(&mut update_sign.line2);
11001100
format::convert_legacy(&mut update_sign.line3);
@@ -1109,7 +1109,6 @@ impl Server {
11091109
}
11101110

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

11311130
fn on_player_info(&mut self, player_info: packet::play::clientbound::PlayerInfo) {
11321131
use crate::protocol::packet::PlayerDetail::*;
1133-
use base64;
1134-
use serde_json;
11351132
for detail in player_info.inner.players {
11361133
match detail {
11371134
Add { name, uuid, properties, display, gamemode, ping} => {

src/world/mod.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,6 @@ impl World {
327327
}
328328

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

334332
let mut valid_dirs = [false; 6];
@@ -587,7 +585,6 @@ impl World {
587585
}
588586

589587
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> {
590-
use std::io::Read;
591588
use byteorder::ReadBytesExt;
592589

593590
let cpos = CPos(x, z);
@@ -705,9 +702,6 @@ impl World {
705702
}
706703

707704
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> {
708-
use std::io::Read;
709-
use crate::types::nibble;
710-
711705
let cpos = CPos(x, z);
712706
{
713707
let chunk = if new {
@@ -836,7 +830,7 @@ impl World {
836830
}
837831

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

0 commit comments

Comments
 (0)