mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-07-01 13:29:06 +02:00
Fix 1.88.0 clippy warnings
This commit is contained in:
parent
ec4fd79864
commit
64e7375f2f
6 changed files with 14 additions and 17 deletions
|
@ -237,7 +237,7 @@ impl Config {
|
|||
fn sign_transform(splitter: &Regex, transform: &str) -> Result<(Regex, String)> {
|
||||
let captures = splitter
|
||||
.captures(transform)
|
||||
.with_context(|| format!("Invalid transform pattern '{}'", transform))?;
|
||||
.with_context(|| format!("Invalid transform pattern '{transform}'"))?;
|
||||
let regexp = Regex::new(&captures[1])?;
|
||||
let replacement = captures[2].to_string();
|
||||
Ok((regexp, replacement))
|
||||
|
@ -275,7 +275,7 @@ impl Config {
|
|||
TileKind::Map => "map",
|
||||
TileKind::Lightmap => "light",
|
||||
};
|
||||
let dir = format!("{}/{}", prefix, level);
|
||||
let dir = format!("{prefix}/{level}");
|
||||
[&self.output_dir, Path::new(&dir)].iter().collect()
|
||||
}
|
||||
|
||||
|
|
|
@ -228,7 +228,7 @@ impl<'a> SingleRegionProcessor<'a> {
|
|||
) -> Result<()> {
|
||||
let (chunk, has_unknown) =
|
||||
world::chunk::Chunk::new(&chunk_data, self.block_types, self.biome_types)
|
||||
.with_context(|| format!("Failed to decode chunk {:?}", chunk_coords))?;
|
||||
.with_context(|| format!("Failed to decode chunk {chunk_coords:?}"))?;
|
||||
data.has_unknown |= has_unknown;
|
||||
|
||||
if self.output_needed || self.lightmap_needed {
|
||||
|
@ -238,7 +238,7 @@ impl<'a> SingleRegionProcessor<'a> {
|
|||
block_light,
|
||||
depths,
|
||||
}) = world::layer::top_layer(&mut data.biome_list, &chunk)
|
||||
.with_context(|| format!("Failed to process chunk {:?}", chunk_coords))?
|
||||
.with_context(|| format!("Failed to process chunk {chunk_coords:?}"))?
|
||||
{
|
||||
if self.output_needed {
|
||||
data.chunks[chunk_coords] = Some(Box::new(ProcessedChunk {
|
||||
|
@ -257,10 +257,7 @@ impl<'a> SingleRegionProcessor<'a> {
|
|||
|
||||
if self.entities_needed {
|
||||
let mut block_entities = chunk.block_entities().with_context(|| {
|
||||
format!(
|
||||
"Failed to process block entities for chunk {:?}",
|
||||
chunk_coords,
|
||||
)
|
||||
format!("Failed to process block entities for chunk {chunk_coords:?}")
|
||||
})?;
|
||||
data.entities.block_entities.append(&mut block_entities);
|
||||
}
|
||||
|
@ -407,7 +404,7 @@ impl<'a> RegionProcessor<'a> {
|
|||
self.collect_regions()?.par_iter().try_for_each(|&coords| {
|
||||
let ret = self
|
||||
.process_region(coords)
|
||||
.with_context(|| format!("Failed to process region {:?}", coords))?;
|
||||
.with_context(|| format!("Failed to process region {coords:?}"))?;
|
||||
|
||||
if ret != Status::ErrorMissing {
|
||||
region_send.send(coords).unwrap();
|
||||
|
|
|
@ -249,7 +249,7 @@ impl<'a> TileRenderer<'a> {
|
|||
.filter(|entry| self.region_set.contains(entry))
|
||||
})
|
||||
.try_map(|entry| self.processed_source(entry))
|
||||
.with_context(|| format!("Region {:?} from previous step must exist", coords))?;
|
||||
.with_context(|| format!("Region {coords:?} from previous step must exist"))?;
|
||||
|
||||
let max_timestamp = *sources
|
||||
.iter()
|
||||
|
@ -293,7 +293,7 @@ impl<'a> TileRenderer<'a> {
|
|||
let region_group = self
|
||||
.rt
|
||||
.block_on(self.load_region_group(processed_paths))
|
||||
.with_context(|| format!("Region {:?} from previous step must be loadable", coords))?;
|
||||
.with_context(|| format!("Region {coords:?} from previous step must be loadable"))?;
|
||||
let mut image = image::RgbaImage::new(N, N);
|
||||
Self::render_region(&mut image, ®ion_group);
|
||||
|
||||
|
@ -325,7 +325,7 @@ impl<'a> TileRenderer<'a> {
|
|||
.map(|&coords| {
|
||||
anyhow::Ok(usize::from(
|
||||
self.render_tile(coords)
|
||||
.with_context(|| format!("Failed to render tile {:?}", coords))?,
|
||||
.with_context(|| format!("Failed to render tile {coords:?}"))?,
|
||||
))
|
||||
})
|
||||
.try_reduce(|| 0, |a, b| Ok(a + b))?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue