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

Use Option::map in parse_month of episode #7 #42

Merged
merged 1 commit into from Jul 3, 2018

Conversation

Projects
None yet
2 participants
@vikrrrr
Contributor

vikrrrr commented Jun 26, 2018

Use Option::map instead of a match expression in the parse_month function. Makes it more readable.

Love your show BTW! :)

match => Option::map
Use `Option::<usize>::map` instead of a `match` expression in
the `parse_month` function.
@mre

This comment has been minimized.

Collaborator

mre commented Jun 26, 2018

Uh that's beautiful! Just don't know how to go about later code changes. What I want to avoid is that people get confused when they check the code and it doesn't match with what I showed in the episode.
Hum... maybe an "errata" folder or an "improvements" section in the show notes might be nice.

Come to think of it, how about a "Discussion" section where we collect those best practices and evolve the code over time. The first version of the code would always be the first link in this section and after that, we would chronologically add improvements like yours. What do you think?

@vikrrrr

This comment has been minimized.

Contributor

vikrrrr commented Jun 26, 2018

Yea, we could document every change done between original and current code on a per-episode basis, with an explanation as to why each change was made and a link to the file on a specific commit.

Probably put it in the README of each episode. This also means adding an Improvements section into SHOW_NOTES.md.

@mre mre merged commit 5e4c0a3 into hello-rust:master Jul 3, 2018

@mre

This comment has been minimized.

Collaborator

mre commented Jul 3, 2018

As discussed, updated the show notes and added an "errata" section. Thanks for your contribution @vikrrrr! ⭐️

@vikrrrr vikrrrr deleted the vikrrrr:option-map branch Jul 3, 2018

@vikrrrr

This comment has been minimized.

Contributor

vikrrrr commented Jul 3, 2018

Shouldn't the go here link here use episode.number?

@mre

This comment has been minimized.

Collaborator

mre commented Jul 3, 2018

No. I will always point to episode 8. Forever.
...you're right of course. 😆 Nice catch! Fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment