Skip to content

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.

Lodewijikb added a commit to Lodewijikb/http-api-docs that referenced this pull request Nov 25, 2025
ksasar1000 added a commit to ksasar1000/react-native-app-intro that referenced this pull request Nov 25, 2025
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