mirror of https://codeberg.org/topola/topola.git
chore: fix most warnings
This commit is contained in:
parent
758677970a
commit
e1d875ae72
|
|
@ -78,10 +78,6 @@ impl Trigger {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn triggered(&self) -> bool {
|
|
||||||
self.triggered
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Switch {
|
impl Switch {
|
||||||
|
|
|
||||||
|
|
@ -183,7 +183,7 @@ impl ViewActions {
|
||||||
|
|
||||||
pub fn render_menu(
|
pub fn render_menu(
|
||||||
&mut self,
|
&mut self,
|
||||||
ctx: &Context,
|
_ctx: &Context,
|
||||||
ui: &mut Ui,
|
ui: &mut Ui,
|
||||||
tr: &Translator,
|
tr: &Translator,
|
||||||
menu_bar: &mut MenuBar,
|
menu_bar: &mut MenuBar,
|
||||||
|
|
|
||||||
|
|
@ -294,13 +294,13 @@ impl MenuBar {
|
||||||
.inner
|
.inner
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn update_preferences_menu(ctx: &egui::Context, ui: &mut egui::Ui, tr: &mut Translator) {
|
pub fn update_preferences_menu(_ctx: &egui::Context, ui: &mut egui::Ui, tr: &mut Translator) {
|
||||||
ui.menu_button(tr.text("tr-menu-preferences"), |ui| {
|
ui.menu_button(tr.text("tr-menu-preferences"), |ui| {
|
||||||
ui.menu_button(tr.text("tr-menu-preferences-set-language"), |ui| {
|
ui.menu_button(tr.text("tr-menu-preferences-set-language"), |ui| {
|
||||||
use icu_experimental::displaynames::{
|
use icu_experimental::displaynames::{
|
||||||
DisplayNamesOptions, Fallback, LocaleDisplayNamesFormatter,
|
DisplayNamesOptions, Fallback, LocaleDisplayNamesFormatter,
|
||||||
};
|
};
|
||||||
use icu_locale_core::{locale, LanguageIdentifier, Locale};
|
use icu_locale_core::Locale;
|
||||||
|
|
||||||
let mut display_names_options: DisplayNamesOptions = Default::default();
|
let mut display_names_options: DisplayNamesOptions = Default::default();
|
||||||
display_names_options.fallback = Fallback::None;
|
display_names_options.fallback = Fallback::None;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
use geo::Point;
|
use geo::Point;
|
||||||
use rstar::{Point as _, AABB};
|
use rstar::AABB;
|
||||||
use spade::InsertionError;
|
use spade::InsertionError;
|
||||||
|
|
||||||
use topola::{
|
use topola::{
|
||||||
|
|
@ -12,17 +12,7 @@ use topola::{
|
||||||
selection::{BboxSelectionKind, Selection},
|
selection::{BboxSelectionKind, Selection},
|
||||||
},
|
},
|
||||||
board::{AccessMesadata, Board},
|
board::{AccessMesadata, Board},
|
||||||
drawing::{
|
geometry::shape::AccessShape,
|
||||||
graph::{GetLayer, MakePrimitive},
|
|
||||||
primitive::MakePrimitiveShape,
|
|
||||||
},
|
|
||||||
geometry::shape::{AccessShape, Shape},
|
|
||||||
graph::{GenericIndex, GetPetgraphIndex},
|
|
||||||
layout::{
|
|
||||||
poly::{MakePolygon, PolyWeight},
|
|
||||||
via::ViaWeight,
|
|
||||||
CompoundWeight, Layout, NodeIndex,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::appearance_panel::AppearancePanel;
|
use crate::appearance_panel::AppearancePanel;
|
||||||
|
|
@ -75,8 +65,8 @@ impl Overlay {
|
||||||
|
|
||||||
pub fn drag_start(
|
pub fn drag_start(
|
||||||
&mut self,
|
&mut self,
|
||||||
board: &Board<impl AccessMesadata>,
|
_board: &Board<impl AccessMesadata>,
|
||||||
appearance_panel: &AppearancePanel,
|
_appearance_panel: &AppearancePanel,
|
||||||
at: Point,
|
at: Point,
|
||||||
modifiers: &egui::Modifiers,
|
modifiers: &egui::Modifiers,
|
||||||
) {
|
) {
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ use geo::{CoordsIter, Point, Polygon};
|
||||||
use rstar::AABB;
|
use rstar::AABB;
|
||||||
use topola::{
|
use topola::{
|
||||||
geometry::{
|
geometry::{
|
||||||
primitive::{AccessPrimitiveShape, PrimitiveShape},
|
primitive::PrimitiveShape,
|
||||||
shape::AccessShape,
|
shape::AccessShape,
|
||||||
},
|
},
|
||||||
math::Circle,
|
math::Circle,
|
||||||
|
|
@ -72,7 +72,7 @@ impl<'a> Painter<'a> {
|
||||||
};
|
};
|
||||||
self.ui.painter().add(egui::Shape::rect_stroke(
|
self.ui.painter().add(egui::Shape::rect_stroke(
|
||||||
self.transform * rect,
|
self.transform * rect,
|
||||||
egui::Rounding::ZERO,
|
egui::CornerRadius::ZERO,
|
||||||
egui::Stroke::new(1.0, color),
|
egui::Stroke::new(1.0, color),
|
||||||
egui::StrokeKind::Inside,
|
egui::StrokeKind::Inside,
|
||||||
));
|
));
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ impl StatusBar {
|
||||||
pub fn update(
|
pub fn update(
|
||||||
&mut self,
|
&mut self,
|
||||||
ctx: &egui::Context,
|
ctx: &egui::Context,
|
||||||
tr: &Translator,
|
_tr: &Translator,
|
||||||
viewport: &Viewport,
|
viewport: &Viewport,
|
||||||
maybe_activity: Option<&ActivityStepperWithStatus>,
|
maybe_activity: Option<&ActivityStepperWithStatus>,
|
||||||
) {
|
) {
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ use rstar::{Envelope, AABB};
|
||||||
use topola::{
|
use topola::{
|
||||||
autorouter::{
|
autorouter::{
|
||||||
execution::Command,
|
execution::Command,
|
||||||
invoker::{GetGhosts, GetMaybeNavcord, GetMaybeNavmesh, GetObstacles, Invoker},
|
invoker::{GetGhosts, GetMaybeNavcord, GetMaybeNavmesh, GetObstacles},
|
||||||
},
|
},
|
||||||
board::AccessMesadata,
|
board::AccessMesadata,
|
||||||
drawing::{
|
drawing::{
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,8 @@ fn main() -> Result<(), std::io::Error> {
|
||||||
let invoker = Invoker::new(Autorouter::new(board).unwrap());
|
let invoker = Invoker::new(Autorouter::new(board).unwrap());
|
||||||
|
|
||||||
let mut file = File::create("example.ses").unwrap();
|
let mut file = File::create("example.ses").unwrap();
|
||||||
design.write_ses(invoker.autorouter().board(), &mut file);
|
design.write_ses(invoker.autorouter().board(), &mut file).unwrap();
|
||||||
|
|
||||||
let filename = design.get_name();
|
//let filename = design.get_name();
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ use crate::{
|
||||||
use super::{Autorouter, AutorouterError, AutorouterOptions};
|
use super::{Autorouter, AutorouterError, AutorouterOptions};
|
||||||
|
|
||||||
pub struct PointrouteExecutionStepper {
|
pub struct PointrouteExecutionStepper {
|
||||||
point: Point,
|
|
||||||
route: RouteStepper,
|
route: RouteStepper,
|
||||||
options: AutorouterOptions,
|
options: AutorouterOptions,
|
||||||
}
|
}
|
||||||
|
|
@ -49,7 +48,6 @@ impl PointrouteExecutionStepper {
|
||||||
let mut router = Router::new(autorouter.board.layout_mut(), options.router_options);
|
let mut router = Router::new(autorouter.board.layout_mut(), options.router_options);
|
||||||
|
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
point,
|
|
||||||
route: router.route(
|
route: router.route(
|
||||||
LayoutEdit::new(),
|
LayoutEdit::new(),
|
||||||
origin,
|
origin,
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@
|
||||||
|
|
||||||
use contracts_try::{debug_ensures, debug_invariant};
|
use contracts_try::{debug_ensures, debug_invariant};
|
||||||
use derive_getters::Getters;
|
use derive_getters::Getters;
|
||||||
use enum_dispatch::enum_dispatch;
|
|
||||||
use geo::Point;
|
use geo::Point;
|
||||||
|
|
||||||
use core::fmt;
|
use core::fmt;
|
||||||
|
|
|
||||||
|
|
@ -209,10 +209,6 @@ impl<'a, W, CW: Copy, R: AccessRules> GenericPrimitive<'a, W, CW, R> {
|
||||||
unreachable!()
|
unreachable!()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn primitive<WW>(&self, index: GenericIndex<WW>) -> GenericPrimitive<WW, CW, R> {
|
|
||||||
GenericPrimitive::new(index, self.drawing)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, W, CW: Copy, R: AccessRules> GetInterior<PrimitiveIndex>
|
impl<'a, W, CW: Copy, R: AccessRules> GetInterior<PrimitiveIndex>
|
||||||
|
|
|
||||||
|
|
@ -35,14 +35,14 @@ impl<'a, M: AccessMesadata> Step<ActivityContext<'a, M>, String> for Interaction
|
||||||
|
|
||||||
fn step(
|
fn step(
|
||||||
&mut self,
|
&mut self,
|
||||||
context: &mut ActivityContext<M>,
|
_context: &mut ActivityContext<M>,
|
||||||
) -> Result<ControlFlow<String>, InteractionError> {
|
) -> Result<ControlFlow<String>, InteractionError> {
|
||||||
Ok(ControlFlow::Break(String::from("")))
|
Ok(ControlFlow::Break(String::from("")))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, M: AccessMesadata> Abort<ActivityContext<'a, M>> for InteractionStepper {
|
impl<'a, M: AccessMesadata> Abort<ActivityContext<'a, M>> for InteractionStepper {
|
||||||
fn abort(&mut self, context: &mut ActivityContext<M>) {
|
fn abort(&mut self, _context: &mut ActivityContext<M>) {
|
||||||
todo!();
|
todo!();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ impl<M: AccessMesadata> Interactor<M> {
|
||||||
invoker: &mut self.invoker,
|
invoker: &mut self.invoker,
|
||||||
}) {
|
}) {
|
||||||
Ok(ControlFlow::Continue(())) => ControlFlow::Continue(()),
|
Ok(ControlFlow::Continue(())) => ControlFlow::Continue(()),
|
||||||
Ok(ControlFlow::Break(msg)) => ControlFlow::Break(Ok(())),
|
Ok(ControlFlow::Break(_msg)) => ControlFlow::Break(Ok(())),
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
self.activity = None;
|
self.activity = None;
|
||||||
ControlFlow::Break(Err(err))
|
ControlFlow::Break(Err(err))
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,7 @@
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
use geo::algorithm::line_measures::{Distance, Euclidean};
|
use geo::{geometry::Point, Line};
|
||||||
use geo::{geometry::Point, point, Line};
|
|
||||||
use specctra_core::math::Circle;
|
use specctra_core::math::Circle;
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@ use crate::{
|
||||||
drawing::{
|
drawing::{
|
||||||
bend::LooseBendIndex,
|
bend::LooseBendIndex,
|
||||||
dot::FixedDotIndex,
|
dot::FixedDotIndex,
|
||||||
graph::PrimitiveIndex,
|
|
||||||
head::{BareHead, CaneHead, Head},
|
head::{BareHead, CaneHead, Head},
|
||||||
rules::AccessRules,
|
rules::AccessRules,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ use topola::{
|
||||||
},
|
},
|
||||||
board::{AccessMesadata, Board},
|
board::{AccessMesadata, Board},
|
||||||
drawing::{
|
drawing::{
|
||||||
dot::FixedDotIndex,
|
|
||||||
graph::{GetLayer, GetMaybeNet},
|
graph::{GetLayer, GetMaybeNet},
|
||||||
},
|
},
|
||||||
geometry::{shape::MeasureLength, GenericNode},
|
geometry::{shape::MeasureLength, GenericNode},
|
||||||
|
|
@ -178,8 +177,8 @@ pub fn assert_single_layer_groundless_autoroute(
|
||||||
|
|
||||||
if let Some(netname) = autorouter.board().layout().rules().net_netname(net) {
|
if let Some(netname) = autorouter.board().layout().rules().net_netname(net) {
|
||||||
// We don't route ground.
|
// We don't route ground.
|
||||||
let mut org = unionfind.find(origin_dot.petgraph_index());
|
let org = unionfind.find(origin_dot.petgraph_index());
|
||||||
let mut desc = unionfind.find(destination_dot.petgraph_index());
|
let desc = unionfind.find(destination_dot.petgraph_index());
|
||||||
|
|
||||||
if netname != "GND" {
|
if netname != "GND" {
|
||||||
assert_eq!(org, desc);
|
assert_eq!(org, desc);
|
||||||
|
|
|
||||||
|
|
@ -87,6 +87,7 @@ fn test_4x_3rd_order_smd_lc_filters() {
|
||||||
// FIXME: This test fails indeterministically.
|
// FIXME: This test fails indeterministically.
|
||||||
// NOTE: Disabled until determinism is fixed.
|
// NOTE: Disabled until determinism is fixed.
|
||||||
//#[test]
|
//#[test]
|
||||||
|
#[allow(unused)]
|
||||||
fn test_tht_3pin_xlr_to_tht_3pin_xlr() {
|
fn test_tht_3pin_xlr_to_tht_3pin_xlr() {
|
||||||
let mut autorouter = common::load_design(
|
let mut autorouter = common::load_design(
|
||||||
"tests/single_layer/tht_3pin_xlr_to_tht_3pin_xlr/tht_3pin_xlr_to_tht_3pin_xlr.dsn",
|
"tests/single_layer/tht_3pin_xlr_to_tht_3pin_xlr/tht_3pin_xlr_to_tht_3pin_xlr.dsn",
|
||||||
|
|
@ -106,8 +107,8 @@ fn test_tht_3pin_xlr_to_tht_3pin_xlr() {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_smd_non_rectangular_buck_converter() {
|
fn test_smd_non_rectangular_buck_converter() {
|
||||||
let mut path = "tests/single_layer/smd_non_rectangular_buck_converter/smd_non_rectangular_buck_converter.dsn";
|
let path = "tests/single_layer/smd_non_rectangular_buck_converter/smd_non_rectangular_buck_converter.dsn";
|
||||||
let mut autorouter = common::load_design(&path);
|
let autorouter = common::load_design(&path);
|
||||||
|
|
||||||
let mut invoker = common::create_invoker_and_assert(autorouter);
|
let mut invoker = common::create_invoker_and_assert(autorouter);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue