Quick Tip: You don't need to create a new cargo project if you want to test if something works in rust

96 points menixator

When I'm working with rust, sometimes I'd want to check if something works and I'd either create a new cargo project in a temporary directory or run to the playground.

I always assumed that cargo passed a lot of esoteric options to rustc even for simple programs without any dependencies but I was wrong.

rustc foo.rs

is all you need!