diff --git a/src/main.rs b/src/main.rs index 971f3d0..1833dfa 100644 --- a/src/main.rs +++ b/src/main.rs @@ -299,7 +299,8 @@ fn main2() { let textures = renderer.get_textures(); let dpi_factor = window.window().scale_factor(); let default_protocol_version = protocol::versions::protocol_name_to_protocol_version( - opt.default_protocol_version.unwrap_or("".to_string()), + opt.default_protocol_version + .unwrap_or_else(|| "".to_string()), ); let mut game = Game { server: server::Server::dummy_server(resource_manager.clone()), diff --git a/src/model/mod.rs b/src/model/mod.rs index 7956b7b..7a6c365 100644 --- a/src/model/mod.rs +++ b/src/model/mod.rs @@ -891,7 +891,7 @@ impl RawModel { .texture_vars .get(&name[1..]) .cloned() - .unwrap_or("".to_owned()); + .unwrap_or_else(|| "".to_owned()); return self.lookup_texture(&tex); } name.to_owned() diff --git a/src/world/mod.rs b/src/world/mod.rs index 711689a..c56f091 100644 --- a/src/world/mod.rs +++ b/src/world/mod.rs @@ -994,6 +994,7 @@ impl World { self.load_chunk19_or_115(false, x, z, new, mask, data) } + #[allow(clippy::or_fun_call)] fn load_chunk19_or_115( &mut self, read_biomes: bool, @@ -1068,6 +1069,7 @@ impl World { mappings .get(&id) .cloned() + // TODO: fix or_fun_call, but do not re-borrow self .unwrap_or(block::Block::by_vanilla_id( id, self.protocol_version,