mirror of https://codeberg.org/topola/topola.git
refactor(ApplyGeometryEdit): make 'apply' take 'GeometryEdit' by reference
This commit is contained in:
parent
27a4b61c4d
commit
5a26c02b4e
|
|
@ -175,7 +175,7 @@ impl<M: AccessMesadata> Invoker<M> {
|
|||
let last_done = self.history.last_done()?;
|
||||
|
||||
if let Some(edit) = last_done.edit() {
|
||||
self.autorouter.board.apply(edit.reverse());
|
||||
self.autorouter.board.apply(&edit.reverse());
|
||||
}
|
||||
|
||||
Ok(self.history.undo()?)
|
||||
|
|
@ -187,7 +187,7 @@ impl<M: AccessMesadata> Invoker<M> {
|
|||
let last_undone = self.history.last_undone()?;
|
||||
|
||||
if let Some(edit) = last_undone.edit() {
|
||||
self.autorouter.board.apply(edit.clone());
|
||||
self.autorouter.board.apply(edit);
|
||||
}
|
||||
|
||||
Ok(self.history.redo()?)
|
||||
|
|
|
|||
|
|
@ -274,7 +274,7 @@ impl<M: AccessMesadata>
|
|||
BendIndex,
|
||||
> for Board<M>
|
||||
{
|
||||
fn apply(&mut self, edit: LayoutEdit) {
|
||||
fn apply(&mut self, edit: &LayoutEdit) {
|
||||
self.layout.apply(edit);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1134,7 +1134,7 @@ impl<CW: Copy, R: AccessRules>
|
|||
BendIndex,
|
||||
> for Drawing<CW, R>
|
||||
{
|
||||
fn apply(&mut self, edit: DrawingEdit<CW>) {
|
||||
fn apply(&mut self, edit: &DrawingEdit<CW>) {
|
||||
self.recording_geometry_with_rtree.apply(edit);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ pub trait ApplyGeometryEdit<
|
|||
BI: GetPetgraphIndex + Into<PI> + Eq + Hash + Copy,
|
||||
>
|
||||
{
|
||||
fn apply(&mut self, edit: GeometryEdit<PW, DW, SW, BW, CW, PI, DI, SI, BI>);
|
||||
fn apply(&mut self, edit: &GeometryEdit<PW, DW, SW, BW, CW, PI, DI, SI, BI>);
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
|
|
|
|||
|
|
@ -395,7 +395,7 @@ impl<
|
|||
> ApplyGeometryEdit<PW, DW, SW, BW, CW, PI, DI, SI, BI>
|
||||
for RecordingGeometryWithRtree<PW, DW, SW, BW, CW, PI, DI, SI, BI>
|
||||
{
|
||||
fn apply(&mut self, edit: GeometryEdit<PW, DW, SW, BW, CW, PI, DI, SI, BI>) {
|
||||
fn apply(&mut self, edit: &GeometryEdit<PW, DW, SW, BW, CW, PI, DI, SI, BI>) {
|
||||
for (compound, (maybe_old_data, ..)) in &edit.compounds {
|
||||
if maybe_old_data.is_some() {
|
||||
self.geometry_with_rtree.remove_compound(*compound);
|
||||
|
|
|
|||
|
|
@ -341,7 +341,7 @@ impl<R: AccessRules>
|
|||
BendIndex,
|
||||
> for Layout<R>
|
||||
{
|
||||
fn apply(&mut self, edit: LayoutEdit) {
|
||||
fn apply(&mut self, edit: &LayoutEdit) {
|
||||
self.drawing.apply(edit);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue