> brew install rust
==> Downloading https: ....
... etc
==> Pouring rust
....
From the command line:
> cargo --version
cargo 1.x.x ....
If this fails, may be you have to modify your PATH variable
From the command line:
- CD into the project directory:
cd $PROJECTS/leng-prog/rust-exercises/example
- Run
cargo build
. It should compile OK. - Run
cargo test
. Tests should pass. - Run from command line (The binary is generated under
target/debug
):
> target/debug/example
Usage:
hello <your name>
oblique_shot <angle in degrees> <velocity in m/s>
> target/debug/example hello Newton
Hello Newton!
> target/debug/example oblique_shot 45 10
Range: 10.20m, Time: 2.55s
It should open the project.