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.
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.
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.
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 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 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.
How to Import Modules from Another File in Rust Cargo Projects
Learn how to split Rust code into multiple files and import modules correctly in a Cargo project using mod and module paths.
How to Join a Vec<String> into One String in Rust
Learn how to join a Vec<String> into a single String in Rust using join(), with examples, pitfalls, and practical patterns.
How to Match a String in Rust: String vs &str in match Expressions
Learn how to match String values in Rust using &str, as_str(), and pattern matching with clear examples and common mistakes.
How to Print the Type of a Variable in Rust
Learn how to inspect and print a variable's type in Rust using std::any::type_name, with examples, caveats, and beginner-friendly guidance.
How to Split a String in Rust
Learn how to split strings in Rust using `split`, delimiters, patterns, and practical examples for parsing text safely.
How to Update Cargo to the Latest Official Release in Rust
Learn how Cargo is updated in Rust, why Cargo and rustc versions can differ, and the correct way to get the latest stable release.
Managing Object Lifetimes Safely in Rust Garbage Collector APIs
Learn how Rust lifetimes model heap-owned object validity and how to design safer garbage collector APIs with handles and borrowing.
Reading and Writing Files in Rust 1.x Without Panicking
Learn the idiomatic way to read and write files in Rust 1.x using Result, File, BufReader, and proper error handling.
Rust ? Operator Explained: Error Propagation for Beginners
Learn what the `?` operator means in Rust, how it propagates errors, and when to use it with `Result` and `Option` values.
Rust Auto-Dereferencing Rules in Method Calls Explained
Learn Rust's auto-dereferencing and auto-borrowing rules for method calls, including Deref, receiver lookup order, and common edge cases.
Page 1 of 2 - 32 questions