mirror of https://codeberg.org/topola/topola.git
refactor(topola): apply simple clippy fixes
This commit is contained in:
parent
2f10462cb2
commit
b94b2f9728
|
|
@ -202,6 +202,6 @@ impl<M: AccessMesadata> Invoker<M> {
|
|||
self.execute(entry.command().clone());
|
||||
}
|
||||
|
||||
self.history.set_undone(undone.into_iter());
|
||||
self.history.set_undone(undone);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -239,15 +239,10 @@ impl<M: AccessMesadata> Board<M> {
|
|||
|
||||
/// Finds a band between two pin names.
|
||||
pub fn band_between_pins(&self, pinname1: &str, pinname2: &str) -> Option<BandUid> {
|
||||
if let Some(band) = self
|
||||
.band_bandname
|
||||
self.band_bandname
|
||||
// note: it doesn't matter in what order pinnames are given, the constructor sorts them
|
||||
.get_by_right(&BandName::new(pinname1.to_string(), pinname2.to_string()))
|
||||
{
|
||||
Some(*band)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
.copied()
|
||||
}
|
||||
|
||||
/// Returns the mesadata associated with the layout's drawing rules.
|
||||
|
|
|
|||
|
|
@ -495,10 +495,9 @@ impl<CW: Copy, R: AccessRules> Drawing<CW, R> {
|
|||
|
||||
if let Some(outer) = self.primitive(cane.bend).outer() {
|
||||
self.update_this_and_outward_bows(recorder, outer)
|
||||
.map_err(|err| {
|
||||
.inspect_err(|_| {
|
||||
let joint = self.primitive(cane.bend).other_joint(cane.dot);
|
||||
self.remove_cane(recorder, &cane, joint);
|
||||
err
|
||||
})?;
|
||||
}
|
||||
|
||||
|
|
@ -669,20 +668,18 @@ impl<CW: Copy, R: AccessRules> Drawing<CW, R> {
|
|||
let seg_to = self.add_dot_with_infringables(recorder, dot_weight, infringables)?;
|
||||
let seg = self
|
||||
.add_seg_with_infringables(recorder, from, seg_to.into(), seg_weight, infringables)
|
||||
.map_err(|err| {
|
||||
.inspect_err(|_| {
|
||||
self.recording_geometry_with_rtree
|
||||
.remove_dot(recorder, seg_to.into());
|
||||
err
|
||||
})?;
|
||||
|
||||
let to = self
|
||||
.add_dot_with_infringables(recorder, dot_weight, infringables)
|
||||
.map_err(|err| {
|
||||
.inspect_err(|_| {
|
||||
self.recording_geometry_with_rtree
|
||||
.remove_seg(recorder, seg.into());
|
||||
self.recording_geometry_with_rtree
|
||||
.remove_dot(recorder, seg_to.into());
|
||||
err
|
||||
})?;
|
||||
|
||||
let (bend_from, bend_to) = if cw { (to, seg_to) } else { (seg_to, to) };
|
||||
|
|
@ -696,14 +693,13 @@ impl<CW: Copy, R: AccessRules> Drawing<CW, R> {
|
|||
bend_weight,
|
||||
infringables,
|
||||
)
|
||||
.map_err(|err| {
|
||||
.inspect_err(|_| {
|
||||
self.recording_geometry_with_rtree
|
||||
.remove_dot(recorder, to.into());
|
||||
self.recording_geometry_with_rtree
|
||||
.remove_seg(recorder, seg.into());
|
||||
self.recording_geometry_with_rtree
|
||||
.remove_dot(recorder, seg_to.into());
|
||||
err
|
||||
})?;
|
||||
|
||||
Ok(Cane {
|
||||
|
|
|
|||
|
|
@ -197,10 +197,8 @@ impl<
|
|||
}
|
||||
|
||||
pub(super) fn add_compound_at_index(&mut self, compound: GenericIndex<CW>, weight: CW) {
|
||||
self.graph.update_node(
|
||||
compound.petgraph_index(),
|
||||
GenericNode::Compound(weight.into()),
|
||||
);
|
||||
self.graph
|
||||
.update_node(compound.petgraph_index(), GenericNode::Compound(weight));
|
||||
}
|
||||
|
||||
fn init_bend_joints_and_core<W: AccessBendWeight<PW>>(
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ impl<M: AccessMesadata> Step<ActivityContext<'_, M>, String> for ActivityStepper
|
|||
) -> Result<ControlFlow<String>, ActivityError> {
|
||||
let status = self.activity.step(context)?;
|
||||
self.maybe_status = Some(status.clone());
|
||||
Ok(status.into())
|
||||
Ok(status)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -206,10 +206,10 @@ impl SpecctraDesign {
|
|||
.netname_net(&net_pin_assignments.name)
|
||||
.unwrap();
|
||||
|
||||
net_pin_assignments.pins.as_ref().and_then(|pins| {
|
||||
net_pin_assignments.pins.as_ref().map(|pins| {
|
||||
// take the list of pins
|
||||
// and for each pin output (pin name, net id)
|
||||
Some(pins.names.iter().map(move |pinname| (pinname.clone(), net)))
|
||||
pins.names.iter().map(move |pinname| (pinname.clone(), net))
|
||||
})
|
||||
})
|
||||
// flatten the nested iters into a single stream of tuples
|
||||
|
|
|
|||
Loading…
Reference in New Issue