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

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

Merged
merged 1 commit into from Jul 3, 2018
Merged

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

merged 1 commit into from Jul 3, 2018

Conversation

vikrrrr
Copy link
Contributor

@vikrrrr 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! :)

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

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

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
Copy link
Member

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 option-map branch July 3, 2018 06:41
@vikrrrr
Copy link
Contributor Author

vikrrrr commented Jul 3, 2018

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

@mre
Copy link
Member

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants