Resolve warnings
This commit is contained in:
parent
dfdeae5638
commit
b715c4ad06
18 changed files with 48 additions and 35 deletions
|
|
@ -1,6 +1,8 @@
|
|||
use crate::{belt_finding::brute_force::BruteforceBuilder, misc::Map};
|
||||
use factorio_blueprint::{belt::convert_to_blueprint, misc::Beltspeed, BlueprintEntity};
|
||||
use factorio_core::{pathfield::PathField, prelude::*, visualize::Visualize};
|
||||
use factorio_blueprint::{belt::convert_to_blueprint, BlueprintEntity};
|
||||
use factorio_core::{
|
||||
beltoptions::Beltspeed, pathfield::PathField, prelude::*, visualize::Visualize,
|
||||
};
|
||||
use std::{
|
||||
ops::RangeInclusive,
|
||||
time::{Duration, Instant},
|
||||
|
|
|
|||
|
|
@ -184,7 +184,7 @@ struct MapInternal<'a> {
|
|||
end: (Position, Direction),
|
||||
}
|
||||
|
||||
impl<'a> WheightedGraph for MapInternal<'a> {
|
||||
impl WheightedGraph for MapInternal<'_> {
|
||||
type Node = (Position, Direction);
|
||||
|
||||
fn edge(&self, node: &Self::Node, num: usize) -> Option<(Self::Node, f64)> {
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ fn output_blueprint(conflict: &ConflictAvoidance) {
|
|||
let bp = BlueprintString::Blueprint(
|
||||
Blueprint::builder()
|
||||
.entities(belts)
|
||||
.label(format!("test"))
|
||||
.label("solution".to_string())
|
||||
.build(),
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ fn main() {
|
|||
.iter()
|
||||
.map(|f| {
|
||||
let f = File::open(f).unwrap();
|
||||
let mut p = serde_json::from_reader::<File, Problem>(f).unwrap();
|
||||
let p = serde_json::from_reader::<File, Problem>(f).unwrap();
|
||||
|
||||
let c = ConflictAvoidance::new(&p);
|
||||
c.visualize()
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a, 'b, G> Iterator for WheightedGraphEdgeIter<'a, 'b, G>
|
||||
impl<G> Iterator for WheightedGraphEdgeIter<'_, '_, G>
|
||||
where
|
||||
G: WheightedGraph,
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
use crate::belt_finding::conflict_avoidance::ConflictAvoidance;
|
||||
use factorio_core::pathfield::PathField;
|
||||
use factorio_core::prelude::*;
|
||||
use factorio_core::visualize::{image_grid, Color, Symbol, Visualization, Visualize};
|
||||
use factorio_core::{
|
||||
pathfield::PathField,
|
||||
prelude::*,
|
||||
visualize::{image_grid, Color, Symbol, Visualization, Visualize},
|
||||
};
|
||||
use rand::{seq::SliceRandom, Rng};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::sync::atomic::AtomicU32;
|
||||
use std::time::Instant;
|
||||
use std::{sync::atomic::AtomicU32, time::Instant};
|
||||
|
||||
static OUTFILEINDEX: AtomicU32 = AtomicU32::new(0);
|
||||
|
||||
|
|
@ -240,7 +241,7 @@ impl<'a> PathLayout<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> Visualize for PathLayout<'a> {
|
||||
impl Visualize for PathLayout<'_> {
|
||||
fn visualize(&self) -> factorio_core::visualize::Visualization {
|
||||
let mut v = self.layout.visualize();
|
||||
let offset = self.layout.blocks.len();
|
||||
|
|
@ -525,7 +526,7 @@ impl Layout<'_> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> Visualize for Layout<'a> {
|
||||
impl Visualize for Layout<'_> {
|
||||
fn visualize(&self) -> Visualization {
|
||||
let mut v = Visualization::new(self.problem.size);
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ pub struct FibonacciHeap<I> {
|
|||
impl<I: std::fmt::Debug> std::fmt::Debug for FibonacciHeap<I> {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
struct PrintData<'a, I>(&'a Vec<Option<Node<I>>>);
|
||||
impl<'a, I: Debug> Debug for PrintData<'a, I> {
|
||||
impl<I: Debug> Debug for PrintData<'_, I> {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
f.debug_map()
|
||||
.entries(self.0.iter().enumerate().filter_map(|d| {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue