Organizing Project files

So I had success setting up Rust, installing ,hello world etc. But it bothered me tht it was in a main folder pth I could not acces from file explorer...I tried ]to move it and set up a new folder, but it messed up...

How do I set my rust projects to live in a "Rust\projects" scenario so I can access and organize them easier through the file explorer, rather than having to manage files in powershell?

Rust tools do not care where you put your projects. You can put them in whatever folder makes sense to you.

2 Likes

Yes i Know rust does not care but I do :(.
when I make a new folder/directory, I can just assign them to documents\rust\projects yeah?

also unrelated, but i am pretty sure I have all the rust extensions I need, but my VS code does not have a "run button" in right corner like it does for python, is this normal?

thanks!

I don't know what you mean by “assign”. I don't use Windows so perhaps that is something I am not familiar with. The only thing that matters to Rust is the Cargo.toml file and the src folder next to it (and some other optional files), not what folder those are in.

I don't know if there is a way to get a run button like that. You can use the run button in the Run & Debug tab, if you first run the command “rust-analyzer: Generate launch configurations”. You can also use the command “rust-analyzer: Run” command to run the program (or tests) without making a launch configuration.

I see. I did use that but it wasnt spitting out "hello world"...it is running when executed in terminal though...thanks

I disagree with you. For example you have a sharable dependency between my 20 Rust projects, how all these projects will know where the dependency is stored? Only following the certain agreement will help.

1 Like

yes...this was something I thought about when I started chapter 2 I wanted to organize projects more clearly. thanks for sharing