Skip to content

Commit

Permalink
Apply suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
Limeth committed Oct 29, 2020
1 parent 9090fa6 commit 16646ff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
8 changes: 7 additions & 1 deletion core/src/size.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use super::vector::Vector;
use crate::Vector;
use std::f32;

/// An amount of space in 2 dimensions.
Expand Down Expand Up @@ -72,3 +72,9 @@ impl From<Size> for [f32; 2] {
[size.width, size.height]
}
}

impl From<Size> for Vector<f32> {
fn from(size: Size) -> Self {
Vector::new(size.width, size.height)
}
}
8 changes: 0 additions & 8 deletions core/src/vector.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use super::size::Size;

/// A 2D vector.
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct Vector<T = f32> {
Expand Down Expand Up @@ -82,9 +80,3 @@ where
[other.x, other.y]
}
}

impl From<Size> for Vector<f32> {
fn from(size: Size) -> Self {
Vector::new(size.width, size.height)
}
}

0 comments on commit 16646ff

Please sign in to comment.