Rust Learning Repo

Rust

Introduction

  • Cargo.toml file and ./src/ are created with command cargo init --name "[project name]"
  • In the ./src/ directory, there are two files (main.rs and lib.rs)
    • The main function is in the main.rs file.
    • Most logics and self-defined functions are in the lib.rs file.

Usage and reproduce

  • Open Codespaces
    • set up your own CPU/GPU choice
    • Run curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh to install Rust if you haven’t installed one
  • cd into each project
    • Run cargo run -- --help
    • Edit and run make format to format code
  • rust-cli-example
  • rust-new-project-template