Skip to content

Fix the reason for calling a file lib.rs #18140

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

Merged
merged 1 commit into from
Nov 23, 2014
Merged

Conversation

JelteF
Copy link
Contributor

@JelteF JelteF commented Oct 18, 2014

The reason given didn't make any sense when I read it when reading through the docs. I think this is more clear. Please let me know it is also more correct.

@rust-highfive
Copy link
Contributor

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @huonw (or someone else) soon.

and so it's named this, by convention.
We're calling this file `lib.rs` so Cargo knows it is a file that contains the
library functions for this crate. This way we can use the functions in other
files in the project in an easy way.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say that it's still a convention, just one that Cargo knows about.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed.

And also agreed that the sentence is a bit off. How about this:

We're calling this file lib.rs because by convention, Cargo uses that filename as the crate root for this crate.

@huonw huonw assigned steveklabnik and unassigned huonw Oct 29, 2014
@Gankra
Copy link
Contributor

Gankra commented Nov 8, 2014

@JelteF what's your status?

@JelteF
Copy link
Contributor Author

JelteF commented Nov 8, 2014

Sorry, forgot about this a bit. The sentence suggestest by steveklabnik sounds good as well. I would move the by convention to the end of the sentenc however, since it reads a bit weard now. Will change the pull request to reflect that somewhere next week. So it would become this:

We're calling this file lib.rs, because Cargo uses that filename as the crate root by convention.

@emberian
Copy link
Member

Bump, @JelteF. Do you want someone else to carry this forward?

@JelteF
Copy link
Contributor Author

JelteF commented Nov 23, 2014

Fixed the sentence, sorry it took so long.

bors added a commit that referenced this pull request Nov 23, 2014
The reason given didn't make any sense when I read it when reading through the docs. I think this is more clear. Please let me know it is also more correct.
@bors bors closed this Nov 23, 2014
@bors bors merged commit 17f9de3 into rust-lang:master Nov 23, 2014
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.

8 participants