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

Update post 2 with beginner friendly cargo tips #1234

Merged
merged 3 commits into from
Aug 17, 2023
Merged

Update post 2 with beginner friendly cargo tips #1234

merged 3 commits into from
Aug 17, 2023

Conversation

connortsui20
Copy link
Contributor

As a relatively new person to Rust, I confused the .cargo/config.toml with the global cargo config in my home directory (~/.cargo/config.toml). While this is pretty obviously wrong in hindsight, since I've never used the [unstable]` options before, I didn't realize my mistake until this next thing that tripped me up.

For cargo install bootimage, I think it is reasonable to tell the reader to go into a different directory to execute the command, since it might be the case that the reader has never dealt with different targets before and would have no idea that running cargo install for the new target that they just made in a json would be wrong (at least this was me).

This could be worded differently than the changes I made, but I think that the addition of these could only benefit a confused reader.

I'm new to PRs in general so apologies if I messed up something with the branches!

As a relatively new person to Rust, I confused the `.cargo/config.toml` with the global cargo config in my home directory (`~/.cargo/config.toml). While this is pretty obviously wrong in hindsight, since I've never used the `[unstable]` options before, I didn't realize my mistake until this next thing that tripped me up.

For `cargo install bootimage`, I think it is reasonable to tell the reader to go into a different directory to execute the command, since it might be the case that the reader has never dealt with different targets before and would have no idea that running `cargo install` for the new target that they just made in a json would be wrong (at least this was me).

This could be worded differently than the changes I made, but I think that the addition of these could only benefit a confused reader.
Copy link
Owner

@phil-opp phil-opp left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the PR, these are some useful clarifications! The only thing that I'm not sure about is the blog_os prefix in the paths. We don't really use this convention anywhere else, so I fear that this might lead to some confusion too. For example, I could imagine that readers create a blog_os subdirectory within their project folder (which might have a different name).

@connortsui20
Copy link
Contributor Author

Yeah I definitely agree, maybe the above change would make sense? I don't know if it is too wordy though.

@phil-opp
Copy link
Owner

Maybe something like "the .cargo folder should be next to the src folder"?

Copy link
Owner

@phil-opp phil-opp left a comment

Choose a reason for hiding this comment

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

Thanks!

@phil-opp phil-opp merged commit 2e3230e into phil-opp:main Aug 17, 2023
4 checks passed
@connortsui20 connortsui20 deleted the post-02-beginner-cargo-tips branch August 17, 2023 15:46
@connortsui20 connortsui20 restored the post-02-beginner-cargo-tips branch August 18, 2023 12:10
@connortsui20 connortsui20 mentioned this pull request Aug 18, 2023
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