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