Where do you keep your Rust projects on disk?

I'm working on a GUI application that analyzes Rust projects (Cargo.toml, etc.). I think it would be a nice touch if the application guessed where you have Rust projects on disk, and automatically showed you your latest few projects on startup, without the hassle of prompting for for them.

Searching all of $HOME for Cargo.toml is a bit too much (I bet people without SSDs would hate that), so I'm thinking about checking only a few typical directory names where Rust code could be expected.

So, where's your code?

~/src/projectname here.


I use the ~/dev/$PROJECT (Linux) and ~/development/$PROJECT (MacOS) formats respectively.

1 Like

~/checkout for all source managed code.

~/src or ~/source for non-source managed projects

Used to use ~/Development on Windows

1 Like

Because I am still learning Rust and I have no production code I save them in the atypical folder /Users/name/School/Rust.


All my rust projects are inside ~/pt/rust (I keep ~/src for downloaded external source code that's not being worked on, be it in Rust or something else)

Windows has much weaker conventions. Probably Documents (the relocatable known folder) is about as much of a convention that really exists.

I personally have been keeping all my code at D:\repos\.


I tend to have a Projects folder, where i follow the github pattern user/project eg:
~/Projects/[github user / organisation]/[project name] ...


I always store my projects under ~/dev/project-name/ for both linux and macos.

1 Like

I keep my current code under C:\Projects since I'd be short on space otherwise, and then move it to D:\Rust.

I think that if you were to make your GUI be able to keep track of the projects (Move them around, and delete them if you wish, but inside the GUI) after the user made you aware of them, then that would probably remove most of the headache of finding the projects.

I keep most projects under ~/Projects/, and school ones under ~/sch.

~/src/projectname or ~/src/topicname/projectname (on macOS and GNU/Linux).

Hm… I am not sure I would want a program to try to find all Rust projects in a file system.
Especially if slow network filesystems are mounted there.
Passing a folder sounds like a pretty simple thing to me.


Also for me, almost all code goes under ~/Projects, but in a flat structure.

1 Like

Mine are in ~/rustProjects. But I think that's my convention and not something that came from any toolchain.

Scanning the locate database (on UNIX, i.e. Mac / Linux) for "Cargo.toml" probably wouldn't be too bad in terms of filesystem IO. You'd need to exclude the ~/.cargo/ directory.


To provide an example not in ~, I have a second HDD that I store stuff on so it doesn't thrash my SSD too much, so all my Rust code + builds are at /hdd/project_name

1 Like

I put code I own under ~/Documents, with ~/Documents/forks being used for repositories that I've forked and made contributions to.

Since all my projects are gut repositories i habe Thema und er ~/git_repositories/<git repository>

Hmm... my code, in whatever language, lives anywhere and everywhere and can often move around.

I have work related code under a directory named after the company. Personal projects sitting in various places in my home directory. Odd experiments scattered here and there.

All of it is transient. I assume it's all sourced from github, bitbucket or whatever. Where it is the day I want to check it out and work on it is of no consequence.

Perhaps I'm too chaotic.