rust/hwphysics/src/common.rs
changeset 15292 3bb3fe1cf87c
parent 15287 478d5372eb4a
child 15293 0f734fa371e1
--- a/rust/hwphysics/src/common.rs	Sat Aug 03 01:13:45 2019 +0300
+++ b/rust/hwphysics/src/common.rs	Sat Aug 03 02:14:07 2019 +0300
@@ -108,13 +108,13 @@
 }
 
 pub struct GearDataLookup<T> {
-    lookup: [LookupEntry<T>; u16::max_value() as usize],
+    lookup: Box<[LookupEntry<T>]>,
 }
 
 impl<T: Default + Copy> GearDataLookup<T> {
     pub fn new() -> Self {
         Self {
-            lookup: [LookupEntry::<T>::default(); u16::max_value() as usize],
+            lookup: Vec::with_capacity(u16::max_value() as usize).into_boxed_slice()
         }
     }
 }