Skip to content

Various tests performed while going through the Rust book

License

Notifications You must be signed in to change notification settings

adrianp/rust_book_tests

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My run through the Rust book

Some useful commands:

  • To create a new project: cargo new some_rust_project
  • To check the current project: cargo check
  • To build the current project: cargo build (--release will build with optimizations)
  • To run current project: cargo run; if multiple targets are available you'll need to add the default-run manifest key
  • To run a specific file:cargo run --bin structs
  • To compile a specific file: rustc src/structs.rs -o main
  • To update Rust: rustup update
  • To generate local documentation: rustup doc
  • To format the code: cargo fmt
  • To check the code for issues: cargo clippy or cargo clippy -- -A clippy::all (also see docs)
  • To update dependencies: cargo update
  • To show dependencies: cargo tree
  • To remove unused installed dependencies: cargo clean
  • To run tests: RUST_BACKTRACE=1 cargo test [--bin <binary name>]

The Rust module system, includes:

  • Modules and use: Let you control the organization, scope, and privacy of paths
  • Crates: A tree of modules that produces a library or executable (we have binary and library crates)
  • Packages: A Cargo feature that lets you build, test, and share crates
  • Paths: A way of naming an item, such as a struct, function, or module

Other resources:

About

Various tests performed while going through the Rust book

Topics

Resources

License

Stars

Watchers

Forks

Languages