Apply suggestions
This commit is contained in:
parent
9090fa6a22
commit
16646ffc41
@ -1,4 +1,4 @@
|
|||||||
use super::vector::Vector;
|
use crate::Vector;
|
||||||
use std::f32;
|
use std::f32;
|
||||||
|
|
||||||
/// An amount of space in 2 dimensions.
|
/// An amount of space in 2 dimensions.
|
||||||
@ -72,3 +72,9 @@ impl From<Size> for [f32; 2] {
|
|||||||
[size.width, size.height]
|
[size.width, size.height]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl From<Size> for Vector<f32> {
|
||||||
|
fn from(size: Size) -> Self {
|
||||||
|
Vector::new(size.width, size.height)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
use super::size::Size;
|
|
||||||
|
|
||||||
/// A 2D vector.
|
/// A 2D vector.
|
||||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||||
pub struct Vector<T = f32> {
|
pub struct Vector<T = f32> {
|
||||||
@ -82,9 +80,3 @@ where
|
|||||||
[other.x, other.y]
|
[other.x, other.y]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<Size> for Vector<f32> {
|
|
||||||
fn from(size: Size) -> Self {
|
|
||||||
Vector::new(size.width, size.height)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user