mirror of https://codeberg.org/topola/topola.git
cleanup: Remove unused imports, formatting
This commit is contained in:
parent
708fbb98f1
commit
b52eefb1a3
|
|
@ -1,6 +1,6 @@
|
||||||
use contracts::{debug_ensures, debug_requires};
|
use contracts::{debug_ensures, debug_requires};
|
||||||
use enum_dispatch::enum_dispatch;
|
use enum_dispatch::enum_dispatch;
|
||||||
use geo::{EuclideanDistance, EuclideanLength, Point};
|
use geo::{EuclideanLength, Point};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
graph::{BendIndex, BendWeight, DotIndex, DotWeight, Ends, Index, SegIndex, SegWeight},
|
graph::{BendIndex, BendWeight, DotIndex, DotWeight, Ends, Index, SegIndex, SegWeight},
|
||||||
|
|
@ -148,7 +148,7 @@ impl<'a> Draw<'a> {
|
||||||
#[debug_ensures(ret.is_err() -> self.layout.node_count() == old(self.layout.node_count()))]
|
#[debug_ensures(ret.is_err() -> self.layout.node_count() == old(self.layout.node_count()))]
|
||||||
pub fn segbend_around_bend(
|
pub fn segbend_around_bend(
|
||||||
&mut self,
|
&mut self,
|
||||||
mut head: Head,
|
head: Head,
|
||||||
around: BendIndex,
|
around: BendIndex,
|
||||||
width: f64,
|
width: f64,
|
||||||
) -> Result<SegbendHead, ()> {
|
) -> Result<SegbendHead, ()> {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
use geo::Line;
|
use geo::Line;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
draw::{Head, HeadTrait, SegbendHead},
|
draw::{Head, HeadTrait},
|
||||||
graph::{BendIndex, DotIndex},
|
graph::{BendIndex, DotIndex},
|
||||||
layout::Layout,
|
layout::Layout,
|
||||||
math::{self, Circle},
|
math::{self, Circle},
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,10 @@
|
||||||
use contracts::{debug_ensures, debug_invariant};
|
use contracts::debug_invariant;
|
||||||
use geo::Point;
|
use geo::Point;
|
||||||
use petgraph::stable_graph::StableDiGraph;
|
use petgraph::stable_graph::StableDiGraph;
|
||||||
use petgraph::visit::EdgeRef;
|
use petgraph::visit::EdgeRef;
|
||||||
use petgraph::Direction::Incoming;
|
use petgraph::Direction::Incoming;
|
||||||
use rstar::primitives::GeomWithData;
|
use rstar::primitives::GeomWithData;
|
||||||
use rstar::{RTree, RTreeObject};
|
use rstar::{RTree, RTreeObject};
|
||||||
use spade::Triangulation;
|
|
||||||
|
|
||||||
use crate::band::Band;
|
use crate::band::Band;
|
||||||
use crate::bow::Bow;
|
use crate::bow::Bow;
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ use sdl2::render::Canvas;
|
||||||
use sdl2::video::Window;
|
use sdl2::video::Window;
|
||||||
use sdl2::EventPump;
|
use sdl2::EventPump;
|
||||||
use shape::Shape;
|
use shape::Shape;
|
||||||
use std::panic;
|
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
use tracer::{Trace, Tracer};
|
use tracer::{Trace, Tracer};
|
||||||
|
|
||||||
|
|
@ -96,7 +96,7 @@ impl<'a> RouterObserver for DebugRouterObserver<'a> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn on_probe(&mut self, tracer: &Tracer, trace: &Trace, edge: MeshEdgeReference) {
|
fn on_probe(&mut self, tracer: &Tracer, trace: &Trace, _edge: MeshEdgeReference) {
|
||||||
render_times(
|
render_times(
|
||||||
self.event_pump,
|
self.event_pump,
|
||||||
self.canvas,
|
self.canvas,
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
use std::mem::{self, swap};
|
use std::mem::swap;
|
||||||
|
|
||||||
use enum_dispatch::enum_dispatch;
|
use enum_dispatch::enum_dispatch;
|
||||||
use petgraph::stable_graph::{NodeIndex, StableDiGraph};
|
use petgraph::stable_graph::{NodeIndex, StableDiGraph};
|
||||||
|
|
@ -57,7 +57,7 @@ impl<'a, W> GenericPrimitive<'a, W> {
|
||||||
})
|
})
|
||||||
.next()
|
.next()
|
||||||
{
|
{
|
||||||
let weight = *self.graph.node_weight(index).unwrap();
|
let _weight = *self.graph.node_weight(index).unwrap();
|
||||||
|
|
||||||
if let Some(Weight::Bend(..)) = self.graph.node_weight(index) {
|
if let Some(Weight::Bend(..)) = self.graph.node_weight(index) {
|
||||||
return Some(BendIndex::new(index));
|
return Some(BendIndex::new(index));
|
||||||
|
|
@ -103,7 +103,7 @@ impl<'a, W> GenericPrimitive<'a, W> {
|
||||||
})
|
})
|
||||||
.next()
|
.next()
|
||||||
{
|
{
|
||||||
let weight = *self.graph.node_weight(index).unwrap();
|
let _weight = *self.graph.node_weight(index).unwrap();
|
||||||
|
|
||||||
if let Some(Weight::Bend(..)) = self.graph.node_weight(index) {
|
if let Some(Weight::Bend(..)) = self.graph.node_weight(index) {
|
||||||
return Some(BendIndex::new(index));
|
return Some(BendIndex::new(index));
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ impl Router {
|
||||||
let mut tracer = self.tracer(&mesh);
|
let mut tracer = self.tracer(&mesh);
|
||||||
let trace = tracer.start(mesh.vertex(from));
|
let trace = tracer.start(mesh.vertex(from));
|
||||||
|
|
||||||
let (_cost, path) = astar(
|
let (_cost, _path) = astar(
|
||||||
&mesh,
|
&mesh,
|
||||||
mesh.vertex(from),
|
mesh.vertex(from),
|
||||||
&mut RouterAstarStrategy::new(tracer, trace, mesh.vertex(to), observer),
|
&mut RouterAstarStrategy::new(tracer, trace, mesh.vertex(to), observer),
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ use crate::{
|
||||||
draw::{BareHead, Draw, Head, HeadTrait, SegbendHead},
|
draw::{BareHead, Draw, Head, HeadTrait, SegbendHead},
|
||||||
graph::{BendIndex, DotIndex, Ends},
|
graph::{BendIndex, DotIndex, Ends},
|
||||||
layout::Layout,
|
layout::Layout,
|
||||||
mesh::{Mesh, MeshEdgeReference, VertexIndex},
|
mesh::{Mesh, VertexIndex},
|
||||||
primitive::MakeShape,
|
primitive::MakeShape,
|
||||||
rules::Rules,
|
rules::Rules,
|
||||||
};
|
};
|
||||||
|
|
@ -94,8 +94,8 @@ impl<'a> Tracer<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn wrap(&mut self, head: Head, around: DotIndex, width: f64) -> Result<SegbendHead, ()> {
|
fn wrap(&mut self, head: Head, around: DotIndex, width: f64) -> Result<SegbendHead, ()> {
|
||||||
let around_pos = self.layout.primitive(around).weight().circle.pos;
|
let _around_pos = self.layout.primitive(around).weight().circle.pos;
|
||||||
let around_primitive = self.layout.primitive(around);
|
let _around_primitive = self.layout.primitive(around);
|
||||||
|
|
||||||
'blk: {
|
'blk: {
|
||||||
if let Some(mut layer) = self.layout.primitive(around).outer() {
|
if let Some(mut layer) = self.layout.primitive(around).outer() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue