diff --git a/Cargo.lock b/Cargo.lock index e6e0813..d6706ac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,3 +1,5 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. [[package]] name = "adler32" version = "1.0.2" diff --git a/client/lib/src/view/mod.rs b/client/lib/src/view/mod.rs index aa1d2a2..6afe07d 100644 --- a/client/lib/src/view/mod.rs +++ b/client/lib/src/view/mod.rs @@ -88,7 +88,7 @@ fn load_grass_texture<'a, 'b:'a>( let grass_texture = yaglw::texture::Texture2D::new(&gl); let fd = std::fs::File::open("textures/Free_Vector_Grass.png").unwrap(); let buffered_file = std::io::BufReader::new(fd); - let image = try!(image::load(buffered_file, image::ImageFormat::PNG)); + let image = image::load(buffered_file, image::ImageFormat::PNG)?; let (w, h) = image.dimensions(); let colortype = image.color(); assert!(colortype == image::ColorType::RGBA(8)); diff --git a/common/closure_series.rs b/common/closure_series.rs index 4968610..0c7381a 100644 --- a/common/closure_series.rs +++ b/common/closure_series.rs @@ -13,7 +13,7 @@ pub enum Return { pub use self::Return::*; /// The closure type used. -pub type Closure<'a> = Box Return + 'a>; +pub type Closure<'a> = Box Return + 'a>; #[allow(missing_docs)] pub struct T<'a> { diff --git a/common/surroundings_loader.rs b/common/surroundings_loader.rs index 07ae9ed..4bb7cb9 100644 --- a/common/surroundings_loader.rs +++ b/common/surroundings_loader.rs @@ -9,7 +9,7 @@ use stopwatch; use cube_shell::{cube_diff, cube_shell}; -fn surroundings_iter(center: Point3, max_distance: i32) -> Box> + Send> { +fn surroundings_iter(center: Point3, max_distance: i32) -> Box> + Send> { Box::new((0 .. max_distance).flat_map(move |radius| cube_shell(¢er, radius))) } @@ -30,7 +30,7 @@ pub struct T { last_position: Option>, max_load_distance: u32, - to_load: Option> + Send>>, + to_load: Option> + Send>>, to_recheck: VecDeque>, // The distances to the switches between LODs. diff --git a/server/lib/src/client_recv_thread.rs b/server/lib/src/client_recv_thread.rs index 2a5a9ad..26c7806 100644 --- a/server/lib/src/client_recv_thread.rs +++ b/server/lib/src/client_recv_thread.rs @@ -190,7 +190,7 @@ pub fn apply_client_update( Point3::new(high.x.ceil() as i32, high.y.ceil() as i32, high.z.ceil() as i32) }, ), - mosaic: Box::new(tree) as Box + Send>, + mosaic: Box::new(tree) as Box + Send>, min_lg_size: 0, }; @@ -228,10 +228,10 @@ pub fn apply_client_update( Point3::new(high.x.ceil() as i32, high.y.ceil() as i32, high.z.ceil() as i32) }, ), - mosaic: Box::new(sphere) as Box + Send>, + mosaic: Box::new(sphere) as Box + Send>, min_lg_size: 0, }; - let brush: voxel_data::brush::T + Send>> = brush; + let brush: voxel_data::brush::T + Send>> = brush; update_gaia(update_gaia::Message::Brush(brush)); }); }, diff --git a/server/lib/src/server.rs b/server/lib/src/server.rs index cc697f0..1f5df1c 100644 --- a/server/lib/src/server.rs +++ b/server/lib/src/server.rs @@ -33,7 +33,6 @@ pub struct Client { impl Client { #[allow(missing_docs)] pub fn send(&mut self, msg: protocol::ServerToClient) { - use bincode; use bincode::serialize; let msg = serialize(&msg, bincode::Infinite).unwrap(); match self.socket.write(msg.as_ref()) { diff --git a/server/lib/src/update_gaia.rs b/server/lib/src/update_gaia.rs index 3e0e793..b056ceb 100644 --- a/server/lib/src/update_gaia.rs +++ b/server/lib/src/update_gaia.rs @@ -28,7 +28,7 @@ pub enum Message { /// Load some voxels Load(u64, Vec, LoadDestination), /// Apply a brush operation - Brush(voxel_data::brush::T + Send>>), + Brush(voxel_data::brush::T + Send>>), } // TODO: Consider adding terrain loads to a thread pool instead of having one monolithic separate thread. diff --git a/server/lib/terrain/cache_mosaic.rs b/server/lib/terrain/cache_mosaic.rs index 1d6b48f..0f2464d 100644 --- a/server/lib/terrain/cache_mosaic.rs +++ b/server/lib/terrain/cache_mosaic.rs @@ -22,14 +22,14 @@ impl std::hash::Hash for Key { pub type Cache = lru_cache::LruCache>; pub struct T { - pub mosaic : Box + Send>, + pub mosaic : Box + Send>, pub density : Cache, pub normal : Cache>, pub mosaic_density : Cache, pub mosaic_material : Cache>, } -pub fn new(mosaic: Box + Send>) -> T { +pub fn new(mosaic: Box + Send>) -> T { T { mosaic : mosaic, density : lru_cache::LruCache::with_hasher(1 << 10, Default::default()),