Rust

Bits and pieces of Rust

Useful commands

  • To override default toolchain for a particular project: rustup override set nightly. The directory is stored in ~/.rustup/settings.toml (in overrides section) separately from the project itself.

  • To print all package dependencies as a nice tree in the command line, we can use cargo tree - more details herearrow-up-right (works starting from Rust 1.44)

Closures

Common/standard traits, conversion

Lifetimes, NLL

Error handling

Profiling on Mac

Misc

  • "Rust Tidbits: What is a Lang Item?"arrow-up-right - an interesting explanation about traits and other items known to the Rust compiler and marked with #[lang] annotation. I really enjoyed this article, but for some reason it was quite hard to google to find it again (perhaps because I googled "traits" and "lang" is not a very googleable term).

Last updated