Manually ignore warnings
This commit is contained in:
parent
0ced2c3c44
commit
f639082205
10 changed files with 26 additions and 27 deletions
|
|
@ -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,14 +298,15 @@ 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()) {
|
||||
start_nodes.push(Node {
|
||||
pos: Position::new(x, y),
|
||||
electric_pole_type,
|
||||
node_type: NodeType::In,
|
||||
});
|
||||
}
|
||||
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,
|
||||
node_type: NodeType::In,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,11 +135,9 @@ 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)?;
|
||||
}
|
||||
entity_map.serialize_entry("override_stack_size", stack_size)?;
|
||||
}
|
||||
super::EntityType::Production {
|
||||
name: _,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue