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.

rustrust-cargo

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.

rustfunctionparametersarguments

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.

rustlinuxwindows

Handling Errors While Mapping Iterators in Rust

Learn how to stop iterator processing and return errors in Rust using collect, Result, and iterator patterns.

rustrust-result

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.

rustrust-cargo

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.

ruststringstring-concatenation

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.

rust

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.

rust

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.

rust

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.

rustcompiler-warningsdead-code

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.

rustmoduleprogram-entry-pointrust-cargo

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.

ruststring

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.

ruststringmatch

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.

rusttypes

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.

rust

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.

rustpackage-managersrust-cargo

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.

rustgarbage-collectionallocationlifetime

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.

rustfile-io

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.

rustsyntax

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.

rustreferencelanguage-lawyer

Page 1 of 2 - 32 questions

PreviousNext