remove redundant str ref constant

This commit is contained in:
mos 2025-01-11 14:38:19 +01:00
parent 2650fb5476
commit 556fc664bc
1 changed files with 1 additions and 2 deletions

View File

@ -350,7 +350,6 @@ impl Agent {
const BOX_DIFF: f32 = 1024.0;
const DIR_TABLE: &'static [u32] = &[0, 1, 2, 3];
const DIR_STR: &[&str] = &["U", "D", "L", "R"];
fn chromo() -> u32 {
Self::DIR_TABLE[rnd!(Self::DIR_TABLE.len())]
@ -458,7 +457,7 @@ impl Agent {
fn solution(&self) -> String {
(0..self.dir)
.map(|i| Self::DIR_STR[self.dna[i] as usize])
.map(|i| ["U", "D", "L", "R"][self.dna[i] as usize])
.collect()
}
}