use core::ops::Sub;
use crate::Vec2;
#[opimps::impl_ops(Sub)]
#[inline]
fn sub<T: Sub<Output = T> + Copy>(self: Vec2<T>, rhs: Vec2<T>) -> Vec2<T> {
let x = self.x - rhs.x;
let y = self.y - rhs.y;
Vec2 { x, y }
}
#[opimps::impl_ops_rprim(Sub)]
#[inline]
fn sub<T>(self: Vec2<T>, rhs: T) -> Vec2<T> where T: Sub<Output = T> + Copy {
Vec2 { x: self.x - rhs, y: self.y - rhs }
}
#[opimps::impl_ops_lprim(Sub)]
#[inline]
fn sub(self: f32, rhs: Vec2<f32>) -> Vec2<f32> {
let x = self - rhs.x;
let y = self - rhs.y;
Vec2 { x, y }
}
#[opimps::impl_ops_lprim(Sub)]
#[inline]
fn sub(self: f64, rhs: Vec2<f64>) -> Vec2<f64> {
let x = self - rhs.x;
let y = self - rhs.y;
Vec2 { x, y }
}
#[opimps::impl_ops_lprim(Sub)]
#[inline]
fn sub(self: i32, rhs: Vec2<i32>) -> Vec2<i32> {
let x = self - rhs.x;
let y = self - rhs.y;
Vec2 { x, y }
}
#[opimps::impl_ops_lprim(Sub)]
#[inline]
fn sub(self: i64, rhs: Vec2<i64>) -> Vec2<i64> {
let x = self - rhs.x;
let y = self - rhs.y;
Vec2 { x, y }
}