Manually ignore warnings
This commit is contained in:
parent
0ced2c3c44
commit
f639082205
10 changed files with 26 additions and 27 deletions
|
|
@ -42,6 +42,7 @@ enum Tracing {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(ValueEnum, Clone, Copy)]
|
#[derive(ValueEnum, Clone, Copy)]
|
||||||
|
#[allow(clippy::enum_variant_names)]
|
||||||
enum PathfinderArg {
|
enum PathfinderArg {
|
||||||
CaFbh,
|
CaFbh,
|
||||||
CaBh,
|
CaBh,
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ use crate::{
|
||||||
station::{StationBasicSpec, basic_station},
|
station::{StationBasicSpec, basic_station},
|
||||||
};
|
};
|
||||||
use factorio_blueprint::abstraction::{
|
use factorio_blueprint::abstraction::{
|
||||||
Blueprint, ElectricPoleType, Entity, Quality, RailType, UndergroundType,
|
Blueprint, ElectricPoleType, Entity, RailType, UndergroundType,
|
||||||
};
|
};
|
||||||
use factorio_core::{
|
use factorio_core::{
|
||||||
beltoptions::{Beltspeed, Belttype},
|
beltoptions::{Beltspeed, Belttype},
|
||||||
|
|
|
||||||
|
|
@ -223,6 +223,7 @@ pub fn one_loader(
|
||||||
(b, -6)
|
(b, -6)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(clippy::too_many_arguments)]
|
||||||
pub fn basic_station(
|
pub fn basic_station(
|
||||||
load: bool,
|
load: bool,
|
||||||
locomotives: usize,
|
locomotives: usize,
|
||||||
|
|
|
||||||
|
|
@ -161,11 +161,7 @@ pub fn assembly_line(
|
||||||
};
|
};
|
||||||
|
|
||||||
let belt3 = (Direction::Right, input_belt1);
|
let belt3 = (Direction::Right, input_belt1);
|
||||||
let belt4 = if let Some(input_belt2) = input_belt2 {
|
let belt4 = input_belt2.map(|input_belt2| (Direction::Right, input_belt2));
|
||||||
Some((Direction::Right, input_belt2))
|
|
||||||
} else {
|
|
||||||
None
|
|
||||||
};
|
|
||||||
|
|
||||||
for i in 0..(3 * (assembly_machines - 1) + 1) {
|
for i in 0..(3 * (assembly_machines - 1) + 1) {
|
||||||
if let Some((d, t)) = belt1 {
|
if let Some((d, t)) = belt1 {
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ use super::*;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct PowerGraph {
|
struct PowerGraph {
|
||||||
|
#[allow(clippy::type_complexity)]
|
||||||
nodes: HashMap<(Position, ElectricPoleType), (Vec<(Position, ElectricPoleType)>, i64)>,
|
nodes: HashMap<(Position, ElectricPoleType), (Vec<(Position, ElectricPoleType)>, i64)>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -254,7 +255,7 @@ impl Blueprint {
|
||||||
})
|
})
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
|
|
||||||
if roboportmap.len() == 0 {
|
if roboportmap.is_empty() {
|
||||||
return;
|
return;
|
||||||
} else if roboportmap.len() == 1 {
|
} else if roboportmap.len() == 1 {
|
||||||
let roboport = roboportmap.into_iter().next().unwrap();
|
let roboport = roboportmap.into_iter().next().unwrap();
|
||||||
|
|
@ -297,8 +298,10 @@ impl Blueprint {
|
||||||
{
|
{
|
||||||
// dbg!(x, y, electric_pole_type);
|
// dbg!(x, y, electric_pole_type);
|
||||||
let alignment = electric_pole_type.alignment();
|
let alignment = electric_pole_type.alignment();
|
||||||
if x.rem_euclid(2) == alignment && y.rem_euclid(2) == alignment {
|
if x.rem_euclid(2) == alignment
|
||||||
if placibility.placeable(Position::new(x, y), electric_pole_type.size()) {
|
&& y.rem_euclid(2) == alignment
|
||||||
|
&& placibility.placeable(Position::new(x, y), electric_pole_type.size())
|
||||||
|
{
|
||||||
start_nodes.push(Node {
|
start_nodes.push(Node {
|
||||||
pos: Position::new(x, y),
|
pos: Position::new(x, y),
|
||||||
electric_pole_type,
|
electric_pole_type,
|
||||||
|
|
@ -308,7 +311,6 @@ impl Blueprint {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
let mut visited_roboports = vec![start_roboport];
|
let mut visited_roboports = vec![start_roboport];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ impl Serialize for SerialzeEntitiesWrapper<'_> {
|
||||||
let mut entity_array = serializer.serialize_seq(Some(self.0.len()))?;
|
let mut entity_array = serializer.serialize_seq(Some(self.0.len()))?;
|
||||||
|
|
||||||
for (i, (_, e)) in self.0.iter().enumerate() {
|
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()
|
entity_array.end()
|
||||||
|
|
@ -135,12 +135,10 @@ impl Serialize for SerializeEntityWrapper<'_> {
|
||||||
}
|
}
|
||||||
super::EntityType::Inserter {
|
super::EntityType::Inserter {
|
||||||
inserter_type: _,
|
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)?;
|
entity_map.serialize_entry("override_stack_size", stack_size)?;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
super::EntityType::Production {
|
super::EntityType::Production {
|
||||||
name: _,
|
name: _,
|
||||||
recipe,
|
recipe,
|
||||||
|
|
|
||||||
|
|
@ -11,13 +11,13 @@ pub struct BucketQueue<Item> {
|
||||||
impl<Item> std::fmt::Debug for BucketQueue<Item> {
|
impl<Item> std::fmt::Debug for BucketQueue<Item> {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
struct DebugWrapper2<'a, I>(&'a Vec<(usize, I)>);
|
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 {
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
f.debug_list().entries(self.0.iter().map(|v| v.0)).finish()
|
f.debug_list().entries(self.0.iter().map(|v| v.0)).finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
struct DebugWrapper<'a, I>(&'a VecDeque<Vec<(usize, I)>>);
|
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 {
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
f.debug_list()
|
f.debug_list()
|
||||||
.entries(self.0.iter().map(|v| DebugWrapper2(v)))
|
.entries(self.0.iter().map(|v| DebugWrapper2(v)))
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ pub fn greedy_set_cover_simple<S>(universe: usize, sets: &[S]) -> Vec<usize>
|
||||||
where
|
where
|
||||||
S: Deref<Target = [usize]>,
|
S: Deref<Target = [usize]>,
|
||||||
{
|
{
|
||||||
assert!(sets.len() > 0);
|
assert!(!sets.is_empty());
|
||||||
|
|
||||||
let mut r = Vec::new();
|
let mut r = Vec::new();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,9 @@ impl<N> QueueObject<N> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<N> Into<i64> for &QueueObject<N> {
|
impl<N> From<&QueueObject<N>> for i64 {
|
||||||
fn into(self) -> i64 {
|
fn from(val: &QueueObject<N>) -> Self {
|
||||||
self.score
|
val.score
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ struct Args {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(ValueEnum, Clone, Copy)]
|
#[derive(ValueEnum, Clone, Copy)]
|
||||||
|
#[allow(clippy::enum_variant_names)]
|
||||||
enum PathfinderArg {
|
enum PathfinderArg {
|
||||||
CaFbh,
|
CaFbh,
|
||||||
CaBh,
|
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 {
|
match args.pathfinder {
|
||||||
PathfinderArg::CaFbh => {
|
PathfinderArg::CaFbh => {
|
||||||
let p = ConflictAvoidance {
|
let p = ConflictAvoidance {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue