mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-04-21 03:45:07 +02:00
treewide: cargo fmt with 1.85
This commit is contained in:
parent
7bba5bae55
commit
775fcb2d1b
8 changed files with 18 additions and 20 deletions
|
@ -2,11 +2,11 @@
|
||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
fs::File,
|
fs::File,
|
||||||
io::{prelude::*, SeekFrom},
|
io::{SeekFrom, prelude::*},
|
||||||
path::Path,
|
path::Path,
|
||||||
};
|
};
|
||||||
|
|
||||||
use anyhow::{bail, Context, Result};
|
use anyhow::{Context, Result, bail};
|
||||||
use flate2::read::ZlibDecoder;
|
use flate2::read::ZlibDecoder;
|
||||||
use serde::de::DeserializeOwned;
|
use serde::de::DeserializeOwned;
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ mod legacy_block_types;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
use bincode::{BorrowDecode, Decode, Encode};
|
use bincode::{BorrowDecode, Decode, Encode};
|
||||||
use enumflags2::{bitflags, BitFlags};
|
use enumflags2::{BitFlags, bitflags};
|
||||||
|
|
||||||
/// Flags describing special properties of [BlockType]s
|
/// Flags describing special properties of [BlockType]s
|
||||||
#[bitflags]
|
#[bitflags]
|
||||||
|
|
|
@ -205,8 +205,10 @@ pub fn cli() -> Result<()> {
|
||||||
if config.num_threads != config.num_threads_initial {
|
if config.num_threads != config.num_threads_initial {
|
||||||
pool = setup_threads(config.num_threads)?;
|
pool = setup_threads(config.num_threads)?;
|
||||||
}
|
}
|
||||||
pool.install(move || loop {
|
pool.install(move || {
|
||||||
|
loop {
|
||||||
wait_watcher(&args, &watch_channel)?;
|
wait_watcher(&args, &watch_channel)?;
|
||||||
generate(&config, &rt)?;
|
generate(&config, &rt)?;
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ use tracing::{debug, info};
|
||||||
use super::{common::*, region_group::RegionGroup};
|
use super::{common::*, region_group::RegionGroup};
|
||||||
use crate::{
|
use crate::{
|
||||||
io::{fs, storage},
|
io::{fs, storage},
|
||||||
resource::{block_color, needs_biome, Colorf},
|
resource::{Colorf, block_color, needs_biome},
|
||||||
types::*,
|
types::*,
|
||||||
util::coord_offset,
|
util::coord_offset,
|
||||||
};
|
};
|
||||||
|
|
|
@ -4,11 +4,11 @@
|
||||||
//! over different data versions as much as possible.
|
//! over different data versions as much as possible.
|
||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
collections::{btree_map, BTreeMap},
|
collections::{BTreeMap, btree_map},
|
||||||
iter::{self, FusedIterator},
|
iter::{self, FusedIterator},
|
||||||
};
|
};
|
||||||
|
|
||||||
use anyhow::{bail, Context, Result};
|
use anyhow::{Context, Result, bail};
|
||||||
|
|
||||||
use super::{block_entity::BlockEntity, de, section::*};
|
use super::{block_entity::BlockEntity, de, section::*};
|
||||||
use crate::{
|
use crate::{
|
||||||
|
|
|
@ -185,9 +185,9 @@ mod json_color {
|
||||||
|
|
||||||
use minedmap_resource::Color;
|
use minedmap_resource::Color;
|
||||||
use serde::{
|
use serde::{
|
||||||
|
Deserializer, Serializer,
|
||||||
de::{self, Visitor},
|
de::{self, Visitor},
|
||||||
ser::Error as _,
|
ser::Error as _,
|
||||||
Deserializer, Serializer,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Named JSON text colors
|
/// Named JSON text colors
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
use std::fmt::Debug;
|
use std::fmt::Debug;
|
||||||
|
|
||||||
use anyhow::{bail, Context, Result};
|
use anyhow::{Context, Result, bail};
|
||||||
use num_integer::div_rem;
|
use num_integer::div_rem;
|
||||||
use tracing::debug;
|
use tracing::debug;
|
||||||
|
|
||||||
|
@ -400,10 +400,6 @@ impl<'a> BlockLight<'a> {
|
||||||
let (offset, nibble) = div_rem(coords.offset(), 2);
|
let (offset, nibble) = div_rem(coords.offset(), 2);
|
||||||
let byte = block_light[offset] as u8;
|
let byte = block_light[offset] as u8;
|
||||||
|
|
||||||
if nibble == 1 {
|
if nibble == 1 { byte >> 4 } else { byte & 0xf }
|
||||||
byte >> 4
|
|
||||||
} else {
|
|
||||||
byte & 0xf
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue