A bit of cleanup.
This commit is contained in:
parent
e0cd4c3f98
commit
8bbc7bf653
|
@ -38,7 +38,7 @@ fn initialize_stacks(stacks: &mut [Vec<char>], text: &str) {
|
|||
}
|
||||
|
||||
fn move_stacks(stacks: &mut [Vec<char>], text: &str, step: u8) {
|
||||
let fields: Vec<_> = text.split(' ').collect();
|
||||
let fields = text.split(' ').collect::<Vec<_>>();
|
||||
let count = fields[1].parse::<usize>().unwrap();
|
||||
let start = fields[3].parse::<usize>().unwrap();
|
||||
let end = fields[5].parse::<usize>().unwrap();
|
||||
|
@ -54,9 +54,7 @@ fn move_stacks(stacks: &mut [Vec<char>], text: &str, step: u8) {
|
|||
}
|
||||
|
||||
// if we're doing step 1, we're done
|
||||
if crane.is_empty() {
|
||||
return;
|
||||
}
|
||||
if crane.is_empty() { return; }
|
||||
|
||||
// step 2 logic
|
||||
while let Some(item) = crane.pop() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user