cargo
tool for build management.cargo
. main()
function in the src/main.rs
file is the entry point when we execute the Rust application. The src/main.rs
file content is as follows. The code just prints a string “hello world” to the standard output.cargo
. src/main.rs
file is as follows. The env::args()
holds the string values passed from the command line when we execute the program. Here you can also see that we first create a Rust string, and then append more string references to it. Why do we have to concatenate string references instead of string values? Well, that is how Rust makes programs safe. You can read more here.