Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ericm1024
Copy link

No description provided.

Copy link
Contributor

@alex-ozdemir alex-ozdemir left a 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),
};
Copy link
Contributor

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;
Copy link
Contributor

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.
Copy link
Contributor

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(())
}));
Copy link
Contributor

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants