Fixing more rustfmt errors.

This commit is contained in:
Joshua Yanovski 2019-09-16 04:05:36 +02:00
parent 95b02912b6
commit 2abf7cd016
2 changed files with 6 additions and 5 deletions

View File

@ -27,7 +27,7 @@ use common::{
vol::{ReadVol, RectVolSize, Vox},
};
use crossbeam::channel;
use hashbrown::{HashMap, hash_map::Entry};
use hashbrown::{hash_map::Entry, HashMap};
use log::debug;
use metrics::ServerMetrics;
use rand::Rng;
@ -73,11 +73,11 @@ pub struct Server {
thread_pool: ThreadPool,
chunk_tx: channel::Sender<(
Vec2<i32>,
Result<(TerrainChunk, ChunkSupplement), EcsEntity>
Result<(TerrainChunk, ChunkSupplement), EcsEntity>,
)>,
chunk_rx: channel::Receiver<(
Vec2<i32>,
Result<(TerrainChunk, ChunkSupplement), EcsEntity>
Result<(TerrainChunk, ChunkSupplement), EcsEntity>,
)>,
pending_chunks: HashMap<Vec2<i32>, Arc<AtomicBool>>,

View File

@ -71,7 +71,8 @@ impl World {
pub fn generate_chunk(
&self,
chunk_pos: Vec2<i32>,
flag: &AtomicBool) -> Result<(TerrainChunk, ChunkSupplement), ()> {
flag: &AtomicBool,
) -> Result<(TerrainChunk, ChunkSupplement), ()> {
let air = Block::empty();
let stone = Block::new(BlockKind::Dense, Rgb::new(200, 220, 255));
let water = Block::new(BlockKind::Water, Rgb::new(60, 90, 190));
@ -108,7 +109,7 @@ impl World {
for x in 0..TerrainChunkSize::RECT_SIZE.x as i32 {
for y in 0..TerrainChunkSize::RECT_SIZE.y as i32 {
if flag.load(Ordering::Relaxed) {
return Err(())
return Err(());
};
let wpos2d = Vec2::new(x, y)
+ Vec2::from(chunk_pos) * TerrainChunkSize::RECT_SIZE.map(|e| e as i32);