Questions
Rust questions
Choose a question page, learn the concept, then test your understanding with a quiz.
Accessing Cargo Package Metadata in Rust
Learn how to read Cargo package metadata like version, name, and authors in Rust using compile-time environment macros.
Associated Types vs Generic Type Parameters in Rust: When to Use Each
Learn when to use associated types vs generic parameters in Rust traits, with clear rules, examples, and practical API design advice.
Convert an Integer to a String in Rust
Learn the current Rust way to convert integers to strings, why `to_str()` no longer works, and when to use `to_string()` or `format!`.
Default Function Arguments in Rust: What to Use Instead
Learn how Rust handles default function arguments, why they are not supported, and practical patterns to achieve similar behavior.
Does `cargo install` Have an Update Command in Rust?
Learn how to update globally installed Cargo packages in Rust, what `cargo install` does, and the common ways developers reinstall tools safely.
Fixing Rust "link.exe not found" on Windows: Understanding the MSVC Linker
Learn why Rust on Windows fails with "link.exe not found" and how MSVC toolchains, linkers, and Visual C++ build tools work.
Fixing Rust "linker 'cc' not found" on Debian in WSL
Learn why Rust shows "linker 'cc' not found" on Debian in WSL and how to fix it by installing the required C build tools.
Global Variables in Rust: statics, shared state, and better alternatives
Learn whether Rust supports global variables, how `static` works, why `static mut` is risky, and safer patterns for shared state.
Handling Errors While Mapping Iterators in Rust
Learn how to stop iterator processing and return errors in Rust using collect, Result, and iterator patterns.
How Rust i128 Works on 64-Bit Systems
Learn how Rust's i128 and u128 work on 64-bit CPUs, including memory layout, arithmetic, compiler support, and practical examples.
How to Access Command Line Arguments in Rust
Learn how to read command line arguments in Rust using std::env::args, with examples, common mistakes, and practical patterns.
How to Benchmark Programs in Rust
Learn how to measure execution time and benchmark Rust code using Instant, cargo bench, and practical benchmarking patterns.
How to Build Multiple Binaries with Cargo in Rust
Learn how to build multiple binaries with Cargo in Rust, including daemon/client layouts, shared libraries, and Cargo.toml setup.
How to Concatenate Strings in Python: str and String-Like Values
Learn how to concatenate strings in Python, including str values and string-like objects, with examples, mistakes, and best practices.
How to Concatenate Vectors in Rust
Learn how to concatenate vectors in Rust using append, extend, iterators, and ownership rules with clear examples and common pitfalls.
How to Convert String to &'static str in Rust
Learn how String, &str, and &'static str differ in Rust, when conversion is possible, and safe ways to create static string slices.
How to Convert Vec<u8> or &[u8] to String in Rust
Learn how to convert Vec<u8> or &[u8] to String in Rust, handle UTF-8 safely, and print TCP response buffers correctly.
How to Convert a String to an Integer in Rust
Learn how to convert String and &str to integers in Rust using parse, borrowing, and error handling with clear examples.
How to Create a Global Mutable Singleton in Rust
Learn safe ways to build a global mutable singleton in Rust, including statics, lazy initialization, Mutex, and OnceLock patterns.
How to Disable Dead Code Warnings at the Crate Level in Rust
Learn how crate-level attributes work in Rust and how to disable dead_code warnings across an entire crate safely and clearly.
Page 1 of 4 - 62 questions