inline const is funny

This commit is contained in:
Tyler Beckman 2023-12-15 20:01:50 -07:00
parent 4e4cc58bec
commit 6240299f1b
Signed by: Ty
GPG key ID: 2813440C772555A4
2 changed files with 3 additions and 2 deletions

View file

@ -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

View file

@ -1,3 +1,5 @@
#![feature(inline_const)]
use std::{collections::HashMap, num::NonZeroUsize};
use clru::CLruCache;