diff --git a/src/lib.rs b/src/lib.rs index b12e235..7dbd711 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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() } }