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

Missing information about source file name - Getting Started #34523

Closed
hhnr opened this issue Jun 28, 2016 · 1 comment
Closed

Missing information about source file name - Getting Started #34523

hhnr opened this issue Jun 28, 2016 · 1 comment

Comments

@hhnr
Copy link
Contributor

hhnr commented Jun 28, 2016

In the rust book Getting Started section, it is mentioned that we can have source file name as "hello_world.rs", however in the cargo introduction section if we move the file inside src directory and run cargo build, it fails. Having the file renamed as main.rs makes cargo build success. This is not mentioned in the getting started document.

I think the Getting Started section should either say that the file name should be main.rs or if the file name is other than main.rs, it should mention on how to make cargo build succeed by telling the cargo to look for hello_world.rs in the src directory.

https://doc.rust-lang.org/book/getting-started.html

@JIghtuse
Copy link
Contributor

Hm, this hello_world.rs is just an example of multiple-words source file name:

    If you’re using more than one word in your filename, use
    an underscore to separate them; for example, you'd use
    hello_world.rs rather than helloworld.rs.

All other places mention main.rs:

    Next, make a new source file and call it main.rs

    ...
    Now open the main.rs file you just created

    ...
    mv main.rs src/main.rs

I would call it unfortunate place for file naming details: we switch from main.rs to hello_world.rs and back in the same paragaph. It make sense to move this example to some other place.

sophiajt pushed a commit to sophiajt/rust that referenced this issue Sep 26, 2016
Docs: Update to "Getting Started" section

I came across rust-lang#34523 and wanted to suggest a solution. See commit for details.

It seemed like a good place to start contributing, let me know if I did anything wrong 😇
sophiajt pushed a commit to sophiajt/rust that referenced this issue Sep 27, 2016
Docs: Update to "Getting Started" section

I came across rust-lang#34523 and wanted to suggest a solution. See commit for details.

It seemed like a good place to start contributing, let me know if I did anything wrong 😇
@bors bors closed this as completed in 172d321 Sep 27, 2016
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

No branches or pull requests

4 participants