Make `Head`, `Segbend`, `Bow` copyable

Having to move or borrow tem, especially `Head`, makes it really
difficult to appease the borrow checker.
This commit is contained in:
Mikolaj Wielgus 2023-08-31 07:27:42 +02:00
parent 1d5b428bf9
commit 9f201d2c3d
3 changed files with 3 additions and 0 deletions

View File

@ -5,6 +5,7 @@ use crate::graph::{
}; };
use crate::primitive::{Bend, Dot, Seg}; use crate::primitive::{Bend, Dot, Seg};
#[derive(Debug, Clone, Copy)]
pub struct Bow { pub struct Bow {
seg1_dot1: DotIndex, seg1_dot1: DotIndex,
seg1: SegIndex, seg1: SegIndex,

View File

@ -27,6 +27,7 @@ struct Route {
width: f64, width: f64,
} }
#[derive(Debug, Clone, Copy)]
pub struct Head { pub struct Head {
pub dot: DotIndex, pub dot: DotIndex,
pub segbend: Option<Segbend>, pub segbend: Option<Segbend>,

View File

@ -5,6 +5,7 @@ use crate::{
primitive::{Bend, Dot}, primitive::{Bend, Dot},
}; };
#[derive(Debug, Clone, Copy)]
pub struct Segbend { pub struct Segbend {
pub seg: SegIndex, pub seg: SegIndex,
pub dot: DotIndex, pub dot: DotIndex,