GitHunt
PR

Learning to program in rust language

Rust notes

Installation

apt update && apt install -y curl && \
curl https://sh.rustup.rs -sSf | sh -s -- -y
source $HOME/.cargo/env

Compile

rustc main.rs

cargo

cargo new projectX
cargo build

# build and run
cargo run

Misc

Clean up all the main files in the project:

⚠️ Warning: first run the command without -delete flag. .git directory might
contain important files with name main as well. Make sure you do not run this
command with -delete in the root of project directory.

# go to src directory
find . -type f -name main -delete
# github codespace
find /workspaces/rust/src -type f -name main -delete

Resources

Languages

Rust98.7%Shell1.3%

Contributors

Created August 5, 2022
Updated February 15, 2026
pranabdas/rust | GitHunt