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

Remove "pub" specifier from function eat_at_restaurant #1895

Closed
wants to merge 1 commit into from

Conversation

liufeimath
Copy link

I'm removing "pub" specifier from function eat_at_restaurant for two reasons:

  1. The first time this "pub" appears (Ch 7.3, or source code ch07-03-paths-for-referring-to-an-item-in-the-module-tree.md, line 34), we haven't introduced the keyword "pub" yet. It creates confusions.
  2. The "pub" specifier for eat_at_restaurant is not useful or relevant to the whole chapter.

@carols10cents carols10cents added this to the ch7 milestone Apr 12, 2019
carols10cents added a commit that referenced this pull request Apr 12, 2019
Fixes the problem fixed in #1895
@carols10cents
Copy link
Member

Thanks! I've opted to fix this by adding a quick note about what the pub does; you're right that it's not directly relevant to the examples but my intent was to make this as real an example as possible and show a public API function. For the examples that compile, if the pub isn't there, you get an unused code warning, which could be equally confusing.

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