Manually ignore warnings

This commit is contained in:
hal8174 2025-04-26 23:09:54 +02:00
parent 0ced2c3c44
commit f639082205
10 changed files with 26 additions and 27 deletions

View file

@ -42,6 +42,7 @@ enum Tracing {
}
#[derive(ValueEnum, Clone, Copy)]
#[allow(clippy::enum_variant_names)]
enum PathfinderArg {
CaFbh,
CaBh,

View file

@ -3,7 +3,7 @@ use crate::{
station::{StationBasicSpec, basic_station},
};
use factorio_blueprint::abstraction::{
Blueprint, ElectricPoleType, Entity, Quality, RailType, UndergroundType,
Blueprint, ElectricPoleType, Entity, RailType, UndergroundType,
};
use factorio_core::{
beltoptions::{Beltspeed, Belttype},

View file

@ -223,6 +223,7 @@ pub fn one_loader(
(b, -6)
}
#[allow(clippy::too_many_arguments)]
pub fn basic_station(
load: bool,
locomotives: usize,

View file

@ -161,11 +161,7 @@ pub fn assembly_line(
};
let belt3 = (Direction::Right, input_belt1);
let belt4 = if let Some(input_belt2) = input_belt2 {
Some((Direction::Right, input_belt2))
} else {
None
};
let belt4 = input_belt2.map(|input_belt2| (Direction::Right, input_belt2));
for i in 0..(3 * (assembly_machines - 1) + 1) {
if let Some((d, t)) = belt1 {

View file

@ -8,6 +8,7 @@ use super::*;
#[derive(Debug)]
struct PowerGraph {
#[allow(clippy::type_complexity)]
nodes: HashMap<(Position, ElectricPoleType), (Vec<(Position, ElectricPoleType)>, i64)>,
}
@ -254,7 +255,7 @@ impl Blueprint {
})
.collect::<Vec<_>>();
if roboportmap.len() == 0 {
if roboportmap.is_empty() {
return;
} else if roboportmap.len() == 1 {
let roboport = roboportmap.into_iter().next().unwrap();
@ -297,8 +298,10 @@ impl Blueprint {
{
// dbg!(x, y, electric_pole_type);
let alignment = electric_pole_type.alignment();
if x.rem_euclid(2) == alignment && y.rem_euclid(2) == alignment {
if placibility.placeable(Position::new(x, y), electric_pole_type.size()) {
if x.rem_euclid(2) == alignment
&& y.rem_euclid(2) == alignment
&& placibility.placeable(Position::new(x, y), electric_pole_type.size())
{
start_nodes.push(Node {
pos: Position::new(x, y),
electric_pole_type,
@ -308,7 +311,6 @@ impl Blueprint {
}
}
}
}
let mut visited_roboports = vec![start_roboport];

View file

@ -61,7 +61,7 @@ impl Serialize for SerialzeEntitiesWrapper<'_> {
let mut entity_array = serializer.serialize_seq(Some(self.0.len()))?;
for (i, (_, e)) in self.0.iter().enumerate() {
entity_array.serialize_element(&SerializeEntityWrapper(i + 1, &e))?;
entity_array.serialize_element(&SerializeEntityWrapper(i + 1, e))?;
}
entity_array.end()
@ -135,12 +135,10 @@ impl Serialize for SerializeEntityWrapper<'_> {
}
super::EntityType::Inserter {
inserter_type: _,
override_stack_size,
override_stack_size: Some(stack_size),
} => {
if let Some(stack_size) = override_stack_size {
entity_map.serialize_entry("override_stack_size", stack_size)?;
}
}
super::EntityType::Production {
name: _,
recipe,

View file

@ -11,13 +11,13 @@ pub struct BucketQueue<Item> {
impl<Item> std::fmt::Debug for BucketQueue<Item> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
struct DebugWrapper2<'a, I>(&'a Vec<(usize, I)>);
impl<'a, I> std::fmt::Debug for DebugWrapper2<'a, I> {
impl<I> std::fmt::Debug for DebugWrapper2<'_, I> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_list().entries(self.0.iter().map(|v| v.0)).finish()
}
}
struct DebugWrapper<'a, I>(&'a VecDeque<Vec<(usize, I)>>);
impl<'a, I> std::fmt::Debug for DebugWrapper<'a, I> {
impl<I> std::fmt::Debug for DebugWrapper<'_, I> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_list()
.entries(self.0.iter().map(|v| DebugWrapper2(v)))

View file

@ -28,7 +28,7 @@ pub fn greedy_set_cover_simple<S>(universe: usize, sets: &[S]) -> Vec<usize>
where
S: Deref<Target = [usize]>,
{
assert!(sets.len() > 0);
assert!(!sets.is_empty());
let mut r = Vec::new();

View file

@ -15,9 +15,9 @@ impl<N> QueueObject<N> {
}
}
impl<N> Into<i64> for &QueueObject<N> {
fn into(self) -> i64 {
self.score
impl<N> From<&QueueObject<N>> for i64 {
fn from(val: &QueueObject<N>) -> Self {
val.score
}
}

View file

@ -24,6 +24,7 @@ struct Args {
}
#[derive(ValueEnum, Clone, Copy)]
#[allow(clippy::enum_variant_names)]
enum PathfinderArg {
CaFbh,
CaBh,
@ -108,7 +109,7 @@ fn main() {
}
}
fn execute<'a, M: Map>(args: &Args, path_input: PathInput<'a, M>) {
fn execute<M: Map>(args: &Args, path_input: PathInput<'_, M>) {
match args.pathfinder {
PathfinderArg::CaFbh => {
let p = ConflictAvoidance {