Project setup

If you haven’t already,install Rust on your computer(it should only take a few minutes).After that, open a terminal and navigate to the directoryyou want to put your application code into.

Start by runningcargo new grrsin the directory you store your programming projects in.If you look at the newly created grrs directory,you’ll find a typical setup for a Rust project:

  • A Cargo.toml file that contains metadata for our project,incl. a list of dependencies/external libraries we use.
  • A src/main.rs file that is the entry point for our (main) binary.

If you can execute cargo run in the grrs directoryand get a “Hello World”, you’re all set up.

What it might look like

  1. $ cargo new grrs
  2. Created binary (application) `grrs` package
  3. $ cd grrs/
  4. $ cargo run
  5. Compiling grrs v0.1.0 (/Users/pascal/code/grrs)
  6. Finished dev [unoptimized + debuginfo] target(s) in 0.70s
  7. Running `target/debug/grrs`
  8. Hello, world!