Learning Rust Language and Tauri Development Course index

Reference 0002

Cargo + Compiler Loop

The smallest development loop you need before Tauri: create, run, check, format, test.

Core commands

CommandUse it when…
cargo new app-name --binCreate a runnable binary project.
cargo runCompile and run the current package.
cargo checkAsk the compiler for type/borrow errors without producing the final binary. Fast feedback.
cargo fmtFormat code using the standard Rust style.
cargo testRun unit/integration tests.
cargo build --releaseMake an optimized binary for distribution or benchmarking.

Files you will see

Cargo.toml

Manifest: package metadata, edition, dependencies, features.

src/main.rs

Entry point for a binary crate.

src/lib.rs

Entry point for reusable library code.

Cargo.lock

Exact dependency versions. Commit it for application projects.

Mutability rule

Rust bindings are immutable by default. If you plan to assign a new value to a binding, write let mut name = value;. This is not a performance trick; it is an explicitness and safety habit.

let count = 1;
count = count + 1; // compiler error

let mut count = 1;
count = count + 1; // ok