summaryrefslogtreecommitdiff
path: root/engine/src
diff options
context:
space:
mode:
Diffstat (limited to 'engine/src')
-rw-r--r--engine/src/data_types/dimens.rs20
1 files changed, 6 insertions, 14 deletions
diff --git a/engine/src/data_types/dimens.rs b/engine/src/data_types/dimens.rs
index 64a30d3..0621b75 100644
--- a/engine/src/data_types/dimens.rs
+++ b/engine/src/data_types/dimens.rs
@@ -63,26 +63,18 @@ pub struct Dimens3<Value>
pub depth: Value,
}
-impl<Value: Clone> From<Value> for Dimens3<Value>
+impl<Value> From<[Value; 3]> for Dimens3<Value>
{
- fn from(value: Value) -> Self
+ fn from([width, height, depth]: [Value; 3]) -> Self
{
- Self {
- width: value.clone(),
- height: value.clone(),
- depth: value,
- }
+ Self { width, height, depth }
}
}
-impl<Value: Clone> From<(Value, Value, Value)> for Dimens3<Value>
+impl<Value> From<Dimens3<Value>> for [Value; 3]
{
- fn from(value: (Value, Value, Value)) -> Self
+ fn from(Dimens3 { width, height, depth }: Dimens3<Value>) -> Self
{
- Self {
- width: value.0,
- height: value.1,
- depth: value.2,
- }
+ [width, height, depth]
}
}