remove redundant str ref constant
This commit is contained in:
parent
2650fb5476
commit
556fc664bc
|
@ -350,7 +350,6 @@ impl Agent {
|
||||||
const BOX_DIFF: f32 = 1024.0;
|
const BOX_DIFF: f32 = 1024.0;
|
||||||
|
|
||||||
const DIR_TABLE: &'static [u32] = &[0, 1, 2, 3];
|
const DIR_TABLE: &'static [u32] = &[0, 1, 2, 3];
|
||||||
const DIR_STR: &[&str] = &["U", "D", "L", "R"];
|
|
||||||
|
|
||||||
fn chromo() -> u32 {
|
fn chromo() -> u32 {
|
||||||
Self::DIR_TABLE[rnd!(Self::DIR_TABLE.len())]
|
Self::DIR_TABLE[rnd!(Self::DIR_TABLE.len())]
|
||||||
|
@ -458,7 +457,7 @@ impl Agent {
|
||||||
|
|
||||||
fn solution(&self) -> String {
|
fn solution(&self) -> String {
|
||||||
(0..self.dir)
|
(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()
|
.collect()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue