Rust Search

Find the best content on Rust, curated by the community; a search engine for Rustaceans.
jtjlehi.github.io
...let (removes, inserts): (Vec<_>, Vec<_>) = updates .into_iter() // we have to make sure that removes happen at the correct offset .scan(0, |num_inserts, update| { Some(match update { Update::Remove(idx) => Update::Remove(idx + *num_inserts), insert @ Update::Insert(_, _) => { *num_inserts += 1; insert } }) }) .partition(|updates| matches!(updates, Update::Remove(_))) To...
Rust Walkthroughs 2025-03-26 ~14 min read
blog.scottlogic.com
...It first casts times to a signed integer so that it can support negative values and uses a match to work out a transformation to apply based on the current direction. The match control-flow operator is an extremely powerful feature of Rust, similar to Scala’s match or a...
Learn Simple Rust 2020-10-14 ~36 min read
pwy.io
...calling `.city.to_owned()` here is inefficient, because it // will allocate a new string even if the hashmap already contains // the entry; this can be avoided with `.raw_entry_mut()`, but // let's not go crazy } Self { indexed_prices } } /// Returns indices of prices matching given city and occupancy. fn find...
Observations/Thoughts 2024-10-16 ~5 min read
blog.sebastiansastre.co
...In our snippet, the Suspend arm does what handle_suspend does; the match is already a branch. A match on an enum compiles to a jump table or a chain of comparisons. You’ve already paid for a branch. Adding a function call inside one arm adds roughly one more...
Observations/Thoughts 2026-03-11 ~7 min read
rust-lang.github.io
...However, if you’re using Clippy, this will cause the match_same_arms lint to trip! You can silence the lint in this spot, and provide an explanation that indicates you are doing so deliberately, by placing this attribute above the match line: #[allow(match_same_arms, reason = "The arms...
Updates from Rust Core 2018-10-30 ~9 min read
hugopeixoto.net
...Applying the same thresholding and connected pixels detection to this template, I could find the one that more closely matched the digit being detected using Template Matching. In short, this algorithm goes through each pixel inside the bounding box of both the template and the digit, finds how many pixels...
Rust Walkthroughs 2022-03-16 ~7 min read
rust-analyzer.github.io
...numeric literals. #13746 keep comments in "Extract function". #13774 resolve all inference variables in InferenceResult::assoc_resolutions. #13777 parse if correctly after a half-open range in match. #13783, #13784 add parentheses to binding mode hints when they attach to an Or-pattern. #13766 fix config patching logic for addCallParenthesis.
Project/Tooling Updates 2022-12-21 ~1 min read
dev.to
...Option<String> = Option::None; loop { std::thread::sleep(time::Duration::from_secs(1)); println!("Waiting for event..."); let evt = next_event(&client, &r.extension_id); if let Some(req_id) = prev_request.take() { process_result(req_id); } match evt { Ok(evt) => match evt { NextEventResponse::Invoke { request_id, deadline_ms, .. } => { println...
Rust Walkthroughs 2020-11-04 ~10 min read
manishearth.github.io
...enum Foo { Str(String), Bool(bool) } let foo = Foo::Bool(true); // "pattern matching" match foo { Str(s) => /* do something with string `s` */, Bool(b) => /* do something with bool `b` */, } Swift is similar, and also calls them enums enum Foo { case str(String) case boolean(bool) } let foo = Foo.boolean(true...
News & Blog Posts 2017-03-07 ~9 min read
doc.rust-lang.org
...valid in the following conditions as well as the consequent block. • match arms bindings are within the match guard and the match arm expression. • match guard let bindings are valid in the following guard conditions and the match arm expression. Local variable scopes do not extend into item declarations. Pattern...
The Rust Reference Book 2024-01-01 ~8 min read
blog.logrocket.com
...To handle an enum in Rust, you have to match on it. Every time you match on an enum, the compiler makes sure you’re handling all the variants. Not handling a variant is a compile-time error unless you explicitly opt into this behavior using _ => .... #[must_use] Types and...
Learn Standard Rust 2020-08-04 ~11 min read
animaomnium.github.io
...In the long run, I think that pattern-matching on structured data is a much cleaner and less error-prone route. The issue of deeply-nested pattern-matching can be resolved with a little sugar (e.g. do/with/use notation in Haskell/Koka/Gleam): there’s no reason not...
Observations/Thoughts 2023-04-19 ~3 min read
doc.rust-lang.org
...We’ll also define a new function to match the new function defined on Box<T>. We define a struct named MyBox and declare a generic parameter T because we want our type to hold values of any type. The MyBox type is a tuple struct with one element of...
The Rust Programming Language Book 2024-02-01 ~9 min read
oxi-dd65f4.gitlab.io
...As of July 29, 2026, Oxi's frozen 50-document blind sets score 0.828 SSIM with Word and 44/50 page-count matches in Japanese, and 0.825 with 48/50 page-count matches in English. In the published comparison table, English page-count fidelity is the highest among...
Rust Walkthroughs 2026-08-05 ~9 min read
www.lpalmieri.com
...web::Data<PgPool>, ) -> HttpResponse { let name = match SubscriberName::parse(form.0.name) { Ok(name) => name, Err(_) => return HttpResponse::BadRequest().finish(), }; let email = match SubscriberEmail::parse(form.0.email) { Ok(email) => email, Err(_) => return HttpResponse::BadRequest().finish(), }; let new_subscriber = NewSubscriber { email, name }; match insert_subscriber(&pool, &new_subscriber).await { Ok...
Rust Walkthroughs 2021-01-06 ~19 min read
rust-analyzer.github.io
...during code analysis. #3722 fix parsing lambdas with return type. #3724 blame the right queries for memory usage. #3725 fix TypeScript memory leak on server restart. #3745 Merge Imports assist correctly handles *. #3764 fix index out of bounds error during workspace loading. #3761 Fill Match Arms assist correctly preserves comments.
News & Blog Posts 2020-03-31 ~1 min read
rust-analyzer.github.io
#10979 don’t show trait flyimports for impl trait and placeholders. #10976 show case-insensitive exact matches instead of fuzzy flyimport for short paths. #10986 fix lint completions not working for unclosed attributes. #10960 fix handling of macros in extern blocks. #10957 fix some TryToNav impls not upmapping ranges out...
Project/Tooling Updates 2021-12-15 ~1 min read
github.com
...However, if you're using Clippy, this will cause the `match_same_arms` lint to trip! You can silence the lint in this spot, and provide an explanation that indicates you are doing so deliberately, by placing this attribute above the `match` line: ```rust #[allow(match_same_arms, reason = "The...
RFC 2383 RFC 2018-04-02 ~10 min read
system.joekain.com
...I added some debug code to step_over_breakpoint to read back the instruction pointer, using ptrace_util::get_instruction_pointer and added a panic if the two target addresses didn’t match. The panic tripped and reported: Breakpoint targets don't match: RIP-1: 555555558ff0 bp: 555555559040 These targets...
News & Blog Posts 2015-09-28 ~13 min read
wcgw.dev
...One that is very common in Rust as well, the match statement. Using match is close to a switch expression in Java and makes use of pattern matching and destructuring as did the previous example. Here is how this looks like: let who = match anybody_at_all { Some(one) => one...
Observations/Thoughts 2023-01-11 ~20 min read
"Roses are red, Rust-lang is fine, cannot borrow \`i\` as mutable more than once at a time"

Search tips

Type anything to search across articles, videos (including conference talks), podcasts, research, crates, and Rust API documentation. These operators give you finer control — click an example to try it.

Find pages containing all your words. Pages where the words appear together rank higher.
Quote part of your query to keep those words together as an exact phrase within a larger search.
Wrap the whole query in quotes for a verbatim search that matches text exactly, punctuation and all — perfect for Rust syntax. Needs at least 3 characters.
Limit results to a single site. Works on its own () too. One site: per search.

Use the tabs and filters above the results to narrow by content type, publication year, and sort order.