mirror of
https://github.com/Noratrieb/game-wip-dontplay.git
synced 2026-01-17 04:45:02 +01:00
Fix clippy lints
This commit is contained in:
parent
45801205dc
commit
5ed33b785f
2 changed files with 3 additions and 4 deletions
|
|
@ -92,7 +92,7 @@ pub struct IntRect {
|
||||||
pub h: i32,
|
pub h: i32,
|
||||||
}
|
}
|
||||||
impl IntRect {
|
impl IntRect {
|
||||||
pub(crate) fn to_sf(&self) -> sfml::graphics::Rect<i32> {
|
pub(crate) fn to_sf(self) -> sfml::graphics::Rect<i32> {
|
||||||
sfml::graphics::Rect::<i32> {
|
sfml::graphics::Rect::<i32> {
|
||||||
left: self.x,
|
left: self.x,
|
||||||
top: self.y,
|
top: self.y,
|
||||||
|
|
|
||||||
|
|
@ -238,7 +238,7 @@ impl Chunk {
|
||||||
pub fn load_or_gen(chk: ChunkPos, worldgen: &Worldgen, world_path: &Path) -> Chunk {
|
pub fn load_or_gen(chk: ChunkPos, worldgen: &Worldgen, world_path: &Path) -> Chunk {
|
||||||
log::info!("Loading chunk {chk:?} (reg: {:?})", chk.region());
|
log::info!("Loading chunk {chk:?} (reg: {:?})", chk.region());
|
||||||
let reg_filename = world_path.join(format_reg_file_name(chk.region()));
|
let reg_filename = world_path.join(format_reg_file_name(chk.region()));
|
||||||
let chunk = if chunk_exists(®_filename, chk) {
|
if chunk_exists(®_filename, chk) {
|
||||||
log::info!("Chunk exists, loading");
|
log::info!("Chunk exists, loading");
|
||||||
let mut f = File::open(®_filename).unwrap();
|
let mut f = File::open(®_filename).unwrap();
|
||||||
let bitset = ExistenceBitset::read_from_file(&mut f);
|
let bitset = ExistenceBitset::read_from_file(&mut f);
|
||||||
|
|
@ -251,8 +251,7 @@ impl Chunk {
|
||||||
} else {
|
} else {
|
||||||
log::warn!("Chunk at {:?} doesn't exist, generating.", chk);
|
log::warn!("Chunk at {:?} doesn't exist, generating.", chk);
|
||||||
Chunk::gen(chk, worldgen)
|
Chunk::gen(chk, worldgen)
|
||||||
};
|
}
|
||||||
chunk
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn at_mut(&mut self, local: ChunkLocalTilePos) -> &mut Tile {
|
fn at_mut(&mut self, local: ChunkLocalTilePos) -> &mut Tile {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue