While I will admit Cargo has its uses and seems like a very handy tool, I have some irks about it I feel that might be solvable through some assistance. Before I picked up Rust, with C/C++/C#/Java/etc, if I wrote a piece of code I wanted to try out that was part of a bigger project, often a binary and not a library, I’d simply make a small program that uses it in its main() function and then build it with the CLI (ie.
g++ test.cpp mycode.cpp -o test)
However, with Rust, Cargo seems to insist on a directory layout that, in my opinion, is overkill. Additionally, I find myself having to create entirely separate Cargo projects just for these tests because otherwise it either tends to whine about my setup, or it ignores certain code.
I have a hunch that Cargo has the customisation I’m looking for, but I can’t seem to find anything on Google about it. I did try Go in the past, but the package ecosystem really made me cringe. With Rust and Cargo, I see that while there’s a similar ecosystem, there are options for allowing otherwise and I’m thankful for that.