Skip to the content.

How to Install Rust

Mac OSX

Make sure you have brew installed

Install Rust

 >	brew install rust
 ==> Downloading https: ....
 ... etc
 ==> Pouring rust
 ....

Windows & Others

Install Rust

Check it

From the command line:

> cargo --version
cargo 1.x.x ....

If this fails, may be you have to modify your PATH variable

Try your first project

Example

From the command line:

  1. CD into the project directory: cd $PROJECTS/leng-prog/rust-exercises/example
  2. Run cargo build. It should compile OK.
  3. Run cargo test. Tests should pass.
  4. 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

IDE Support

Install haskell Intellij plugin: (Preferences/Plugins/Marketplace) Search for rust.

Open the example project:

1.Click Open and select the example directory

It should open the project.

2.Now you can run it.