use super::Point;
impl<'a, X, Y> Point<&'a X, &'a Y> {
pub fn cloned(&self) -> Point<X, Y>
where
X: Clone,
Y: Clone,
{
Point {
x: self.x.clone(),
y: self.y.clone(),
}
}
pub const fn copied(&self) -> Point<X, Y>
where
X: Copy,
Y: Copy,
{
Point {
x: *self.x,
y: *self.y,
}
}
}
impl<'a, X, Y> Point<&'a mut X, &'a mut Y> {
pub fn cloned(&self) -> Point<X, Y>
where
X: Clone,
Y: Clone,
{
Point {
x: self.x.clone(),
y: self.y.clone(),
}
}
pub const fn copied(&self) -> Point<X, Y>
where
X: Copy,
Y: Copy,
{
Point {
x: *self.x,
y: *self.y,
}
}
}