diff --git a/src/mappings.rs b/src/mappings.rs index 55b4c2a..a417468 100644 --- a/src/mappings.rs +++ b/src/mappings.rs @@ -94,13 +94,13 @@ pub struct StrideMapping { impl StrideMapping { pub fn new() -> Self { - Self::from_json(vec!( + Self::from_json(&[ (0, 0, 255, false) - )) + ]) } pub fn new_jar() -> Self { - Self::from_json(vec!( + Self::from_json(&[ (0, 0, 17, false), (1, 0, 17, false), (2, 0, 17, false), @@ -119,11 +119,11 @@ impl StrideMapping { (15, 0, 17, false), (16, 0, 17, false), (17, 0, 17, false) - )) + ]) } pub fn new_panel() -> Self { - Self::from_json(vec!( + Self::from_json(&[ (0, 0, 16, false), (1, 0, 16, true), (2, 0, 16, false), @@ -140,10 +140,10 @@ impl StrideMapping { (13, 0, 16, true), (14, 0, 16, false), (15, 0, 16, true), - )) + ]) } - pub fn from_json(stride_json: Vec<(u8, u8, u8, bool)>) -> Self { + pub fn from_json(stride_json: &[(u8, u8, u8, bool)]) -> Self { let mut strides = [Stride::default(); STRIDE_NUM]; let stride_count = stride_json.len(); let mut physical_idx = 0;