diff --git a/lib/src/day15/mod.rs b/lib/src/day15/mod.rs index 6da0bf0..749515d 100644 --- a/lib/src/day15/mod.rs +++ b/lib/src/day15/mod.rs @@ -18,8 +18,7 @@ impl Day for Day15 { } fn part2(&mut self) -> String { - const ARRAY_REPEAT_VALUE: Vec<(&str, u8)> = Vec::new(); - let mut boxes: [Vec<(&str, u8)>; 256] = [ARRAY_REPEAT_VALUE; 256]; + let mut boxes = [const { Vec::<(&str, u8)>::new() }; 256]; for operation in self.input.split(',') { let ((box_id, label), focal_length) = operation diff --git a/lib/src/lib.rs b/lib/src/lib.rs index 4e09a00..f4d60c6 100644 --- a/lib/src/lib.rs +++ b/lib/src/lib.rs @@ -1,3 +1,5 @@ +#![feature(inline_const)] + use std::{collections::HashMap, num::NonZeroUsize}; use clru::CLruCache;