Skip to content

Commit 29ba45c

Browse files
author
Tom
committed
Fix warnings
1 parent 6a71140 commit 29ba45c

File tree

11 files changed

+25
-294
lines changed

11 files changed

+25
-294
lines changed

Cargo.lock

Lines changed: 3 additions & 113 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

detailer/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,5 +420,5 @@ impl<'a> Widget<'a> {
420420
});
421421
}
422422

423-
fn show_system_tab(&mut self, ui: &egui::Ui) {}
423+
fn show_system_tab(&mut self, _ui: &egui::Ui) {}
424424
}

drawing/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,4 @@ serde = { version = "1", features = ["derive"] }
1313

1414
# For solver
1515
eq = {version = "0.1.0", path = "../eq"}
16-
#nalgebra = "0.31"
17-
gomez = "0.4"
1816
num = "0.4"

drawing/src/constraints.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
use crate::system::{self, TermAllocator, TermRef, TermType};
1+
use crate::system::{TermRef, TermType};
22
use crate::{Feature, FeatureKey};
33
use eq::{Expression, Rational};
4-
use slotmap::HopSlotMap;
54

65
slotmap::new_key_type! {
76
pub struct ConstraintKey;
@@ -63,7 +62,7 @@ impl Constraint {
6362
match self {
6463
Fixed(..) => matches!(ft, &Feature::Point(..)),
6564
LineLength(..) => matches!(ft, &Feature::LineSegment(..)),
66-
LineAlongCardinal(_, fk, ..) => matches!(ft, &Feature::LineSegment(..)),
65+
LineAlongCardinal(..) => matches!(ft, &Feature::LineSegment(..)),
6766
}
6867
}
6968

@@ -332,7 +331,7 @@ impl Constraint {
332331
}
333332
}
334333

335-
fn distance_eq(d: &TermRef, x1: &TermRef, y1: &TermRef, x2: &TermRef, y2: &TermRef) -> Expression {
334+
fn distance_eq(_d: &TermRef, x1: &TermRef, y1: &TermRef, x2: &TermRef, y2: &TermRef) -> Expression {
336335
Expression::Sqrt(
337336
Box::new(Expression::Sum(
338337
Box::new(Expression::Power(

drawing/src/data/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ impl Data {
221221
}
222222
};
223223

224-
if let Some(Constraint::LineLength(_, fk, _, _, dd)) = self.constraint_mut(k) {
224+
if let Some(Constraint::LineLength(_, _fk, _, _, dd)) = self.constraint_mut(k) {
225225
let c = a.lerp(b, 0.5);
226226
let v = c.to_vec2() - pos.to_vec2();
227227
let reference = egui::Vec2::angled((a - b).angle() - v.angle()) * v.length();

drawing/src/handler.rs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -102,19 +102,8 @@ impl Handler {
102102
},
103103
ToolResponse::NewLineCardinalConstraint(k, is_horizontal) => {
104104
match drawing.features.get(k) {
105-
Some(Feature::LineSegment(_, f1, f2)) => {
106-
let (f1, f2) = (
107-
drawing.features.get(*f1).unwrap(),
108-
drawing.features.get(*f2).unwrap(),
109-
);
110-
let (p1, p2) = match (f1, f2) {
111-
(Feature::Point(_, x1, y1), Feature::Point(_, x2, y2)) => {
112-
(egui::Pos2 { x: *x1, y: *y1 }, egui::Pos2 { x: *x2, y: *y2 })
113-
}
114-
_ => panic!("unexpected subkey types: {:?} & {:?}", f1, f2),
115-
};
116-
117-
let d = p1.distance(p2);
105+
Some(Feature::LineSegment(_, _f1, _f2)) => {
106+
// TODO: Delete/modify existing constraints that would clash, if any
118107

119108
drawing.add_constraint(Constraint::LineAlongCardinal(
120109
ConstraintMeta::default(),

drawing/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ impl<'a> Widget<'a> {
167167
(
168168
Hover::Constraint {
169169
k,
170-
constraint: Constraint::LineLength(_, _, _, _, dd),
170+
constraint: Constraint::LineLength(_, _, _, _, _dd),
171171
},
172172
false,
173173
true,
@@ -224,7 +224,7 @@ impl<'a> Widget<'a> {
224224
Some(Input::FeatureDrag(fk, new_pos))
225225
}
226226

227-
(Some(DragState::Constraint(ck, offset)), _) => {
227+
(Some(DragState::Constraint(ck, _offset)), _) => {
228228
if released {
229229
ui.memory_mut(|mem| mem.data.remove::<DragState>(select_id));
230230
}
@@ -261,7 +261,7 @@ impl<'a> Widget<'a> {
261261
// Handle: clicks altering selection
262262
if hp.is_some()
263263
&& response.clicked_by(egui::PointerButton::Primary)
264-
&& !matches!(current_input, Some(Input::EditingLineLength(ck)))
264+
&& !matches!(current_input, Some(Input::EditingLineLength(_)))
265265
{
266266
let shift_held = ui.input(|i| i.modifiers.shift);
267267

@@ -541,7 +541,7 @@ pub struct DrawResponse {}
541541

542542
#[cfg(test)]
543543
mod tests {
544-
use super::*;
544+
// use super::*;
545545

546546
#[test]
547547
fn simplifications() {}

0 commit comments

Comments
 (0)