by devit · 5y ago · 0 comments
Since Rust has an actual type system, decent programmers usually produce code that works correctly the first time it successfully compiles, so running and testing it is not so important.
If you still need to run many code snippets frequently, create a command line tool with an option parser (e.g. clap in Rust), and create a subcommand for each "code snippet" and you can then invoke them from the command line along with whatever options you need.
You can also use debuggers or add eprintln! calls in existing codebases.
If you are just learning the language and want to test simple examples you can also use online playgrounds like https://play.rust-lang.org
Wow, that is a very big call.