rspace_core/point/
impl_point_repr.rs1use super::Point;
7
8impl<'a, X, Y> Point<&'a X, &'a Y> {
9 pub fn cloned(&self) -> Point<X, Y>
11 where
12 X: Clone,
13 Y: Clone,
14 {
15 Point {
16 x: self.x.clone(),
17 y: self.y.clone(),
18 }
19 }
20 pub const fn copied(&self) -> Point<X, Y>
22 where
23 X: Copy,
24 Y: Copy,
25 {
26 Point {
27 x: *self.x,
28 y: *self.y,
29 }
30 }
31}
32
33impl<'a, X, Y> Point<&'a mut X, &'a mut Y> {
34 pub fn cloned(&self) -> Point<X, Y>
36 where
37 X: Clone,
38 Y: Clone,
39 {
40 Point {
41 x: self.x.clone(),
42 y: self.y.clone(),
43 }
44 }
45 pub const fn copied(&self) -> Point<X, Y>
47 where
48 X: Copy,
49 Y: Copy,
50 {
51 Point {
52 x: *self.x,
53 y: *self.y,
54 }
55 }
56}