跳至主要内容

Ch1 開始入門

Install Rustup

  • rustup負責管理rust版本及相關工具

Compile & Run

rustc {filename} // generate exe file
./{filename}

Cargo

  • 套件管理工具
  • 管理dependencies 常用指令:
  • cargo new <project_name>
    • Create new project with default settings.
  • cargo build
    • Compile and generate exe.
  • cargo run
    • Build and run.
  • cargo check
    • Check if it can compile.