summaryrefslogtreecommitdiffstats
path: root/core/src
diff options
context:
space:
mode:
authorLibravatar Jakub Hlusička <limeth@protonmail.com>2020-10-29 14:50:17 +0100
committerLibravatar Jakub Hlusička <limeth@protonmail.com>2020-10-29 14:57:37 +0100
commit16646ffc4172ffb7b1a6ad0f50afe826ddcf4094 (patch)
tree6253e0a61ecc835e8c1cbb8dc66dae4cc8e7b6f8 /core/src
parent9090fa6a22afcc41d191ad35947ab312bf95918e (diff)
downloadiced-16646ffc4172ffb7b1a6ad0f50afe826ddcf4094.tar.gz
iced-16646ffc4172ffb7b1a6ad0f50afe826ddcf4094.tar.bz2
iced-16646ffc4172ffb7b1a6ad0f50afe826ddcf4094.zip
Apply suggestions
Diffstat (limited to 'core/src')
-rw-r--r--core/src/size.rs8
-rw-r--r--core/src/vector.rs8
2 files changed, 7 insertions, 9 deletions
diff --git a/core/src/size.rs b/core/src/size.rs
index 060f8fa5..5c130978 100644
--- a/core/src/size.rs
+++ b/core/src/size.rs
@@ -1,4 +1,4 @@
-use super::vector::Vector;
+use crate::Vector;
use std::f32;
/// An amount of space in 2 dimensions.
@@ -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)
+ }
+}
diff --git a/core/src/vector.rs b/core/src/vector.rs
index fd00b5ba..e31924e7 100644
--- a/core/src/vector.rs
+++ b/core/src/vector.rs
@@ -1,5 +1,3 @@
-use super::size::Size;
-
/// A 2D vector.
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct Vector<T = f32> {
@@ -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)
- }
-}