-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Eric Mueller submission #5
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
Once you fill out the assignment questionnaire, you're all done!
'c' => Ok(Peg::Center), | ||
'r' => Ok(Peg::Right), | ||
_ => Err(HanoiError::UnknownCommand), | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per your question in class, this could've been a function.
} | ||
|
||
const STARTING_PEG: Peg = Peg::Left; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
// Despite all of our types being `Copy`, `Vec::last` still borrows the last element, so we | ||
// need to explicitly clone it. | ||
// Despite all of our types being `Copy`, `Vec::last` still borrows | ||
// the last element, so we need to explicitly clone it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Rust convention is 99 character lines, rather than 80.
// unwrap is okay since we know we have something to pop | ||
self.pop_disk(from).unwrap(); | ||
Ok(()) | ||
})); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doing the pop after the try!(push_disk)
should be equivalent. Good to see you're comfortable with and_then though!
No description provided.