Rust Search

Find the best content on Rust, curated by the community; a search engine for Rustaceans.
rust-lang-nursery.github.io
...String, } fn parse_email(s: &str) -> Result<String, String> { match s.split_once('@') { Some((user, domain)) if !user.is_empty() && domain.contains('.') => Ok(s.to_string()), _ => Err("Invalid email format".to_string()), } } fn parse_config(s: &str) -> Result<PathBuf, String> { let path = PathBuf::from(s); if path.is_file() { Ok...
The Rust Cookbook Book 2024-01-01 ~1 min read
workers.wasmlabs.dev
...let count = cache.get("counter"); let count_num = match count { Some(count_str) => count_str.parse::<u32>().unwrap_or(0), None => 0, }; let response = format!( "<!DOCTYPE html><body><h1>Key / Value store in Rust</h1><p>Counter: {}</p><p>This page was generated by a Wasm modules built from Rust...
Rust Walkthroughs 2023-01-18 ~6 min read
tessera-ui.github.io
...You don't have to follow rules-of-hooks; you can safely use it inside control flow statements like if, loop, match, etc.However, components like virtual lists may not build all child components every frame. Using remember naively could cause state to drift to the next visible component instance...
Rust Walkthroughs 2025-12-17 ~8 min read
depth-first.com
...subgraph isomorphism; matching; and cycle perception. Isomorphism finds embeddings and atom/bond mappings between two molecules. Matching is used for kekulization, or the assignment of alternating single/double bonds in certain classes of molecule. Many important molecules in medicine and commerce contain one or more cycles, so cycle perception is...
News & Blog Posts 2020-02-18 ~8 min read
thunderseethe.dev
...Ast<TypedVar>) -> IR { match ast { //... } } } We’re well versed in this pattern by now. Match on the ast and produce an IR term for each case. First up is variables:Ast::Var(_, TypedVar(var, ty)) => IR::Var(Var::new( self.supply.supply_for(var), self.types.lower_ty(ty), )), A...
Rust Walkthroughs 2025-02-05 ~7 min read
blog.servo.org
...gterzian rewrote the image loading algorithm to match the behaviour mandated by the specification. waffles added support for various CSS Grid properties in Stylo. jdm removed a GC safety hazard when using CSS transitions. eloycoto improved the behaviour of getBoundingClientRect for elements with margins and transforms. cynicaldevil ensured that all...
News & Blog Posts 2017-06-06 ~1 min read
developerlife.com
...syn::Type = syn::parse_str::<syn::Type>(&traits.join(" + ")).unwrap(); let where_clause_ts = match where_clause { Some(where_clause) => { let where_predicate_punctuated_list = &where_clause.predicates; let modified_where_predicates_ts = where_predicate_punctuated_list .iter() .map( |where_predicate| match where_predicate { syn::WherePredicate::Type(_) => { quote! { #where_predicate...
Rust Walkthroughs 2023-04-26 ~35 min read
johns.codes
...let mut exec = sql_jr_execution::Execution::new(); loop { let readline = rl.readline(">> "); match readline { Ok(line) => { rl.add_history_entry(line.as_str()); let line: &str = line.as_ref(); let res = exec.parse_and_run(line); match res { Ok(exec_res) => println!("{exec_res}"), Err(e) => { let mut s...
Rust Walkthroughs 2023-01-25 ~11 min read
metalbear.co
...Our handler will be called using the C ABI calling convention, it will match on syscalls and redirect them based on their type to their specific detours and return the result in the specific register conforming to the C ABI.#[no_mangle] unsafe extern "C" fn c_abi_syscall_handler...
Rust Walkthroughs 2022-08-17 ~11 min read
tmandry.gitlab.io
...let xs = vec![1, 2, 3]; let mut gen = move || { let mut sum = 0; { let mut iter0 = xs.iter(); loop { match iter0.next() { Some(x0) => { sum += x0; yield sum; // Suspend0 } None => break, } } } { let mut iter1 = xs.iter().rev(); loop { match iter1.next() { Some(x1) => { sum -= x1; yield sum; // Suspend1 } None...
News & Blog Posts 2019-09-10 ~16 min read
chunkofcoal.com
...But the low nibble 0xC only matches COMMA. The AND eliminates QUOTE, leaving just COMMA.Building these lookup tables requires some care. Because the AND combines results from 2 independent lookups, you’re effectively designing a grid. Any byte whose high nibble matches and whose low nibble matches will be...
Rust Walkthroughs 2026-03-25 ~11 min read
cat-solstice.github.io
...That’s wild! replace the hint::select_unpredictable with the worst match statement possible: match f( unsafe { slice.get_unchecked(mid) } ) { Ordering::Less | Ordering::Equal => base = mid, Ordering::Greater => {}, } The performance of all tested cases are now similar to each other (and good) but there is no more conditional moves...
Observations/Thoughts 2025-10-29 ~11 min read
guillaumegomez.github.io
...by text “fn main” in a line comment. @frewsxcv indicated how ChildStd{in,out,err} FDs are closed. @thombles improved diagnostics when attempting to match tuple enum variant with struct pattern. @tirr-c made a friendlier error message for closure argument type mismatch. @estebank pointed at parameter type on E0301...
News & Blog Posts 2017-10-03 ~1 min read
crustc.com
...This implies that there may be an error and we handle that using the unwrap() method or match.For example, let’s see an example code that panic: let my_string = "Zeus".to_string(); let my_int = my_string.parse::<i32>().unwrap();Here, we’re trying to convert a string...
Observations/Thoughts 2024-02-28 ~1 min read
blog.yoshuawuyts.com
...The version I’ve seen which I like the most used type ascription when matching, but that’s hard to implement, and has a bunch of other lang implications as well: match foo(cond) { n: u32 => {}, n: u16 => {} } Though if someone has ideas how to prototype this, it would be...
Observations/Thoughts 2022-02-16 ~11 min read
siciarz.net
...std::io::Read { match *x { Some(_) => {Ok(y)}, None => Err("not happening".into()) } } into this: fn make_it_happen<T, U>(x: &Option<T>, y: U) -> Result<U, String> where T: std::io::Write, U: std::io::Read { match *x { Some(_) => Ok(y), None => Err("not happening".into()), } } rustfmt fixed...
News & Blog Posts 2016-12-06 ~5 min read
blog.servo.org
...cache use origins intead of full URLs jmr0 fixed the event suppression logic for pages that have navigated zakorgy updated some WebBluetooth APIs to match new specification changes New Contributors Arthur Marble Bryan Gilbert Julien Enselme Leonardo Santagada Taryn Hill Tiziana Sellitto Interested in helping build a web browser? Take...
New Crates & Project Updates 2016-09-27 ~1 min read
boats.gitlab.io
...Today, it expands something like this: // This await!(future) // Expands like this loop { match future.poll() { Ok(Async::NotReady) => yield, Ok(Async::Ready(data)) => Ok(data), Err(error) => Err(error), } } Importantly, once you await a future, you can’t do anything with it again. This gives us the leeway to...
News & Blog Posts 2018-02-13 ~5 min read
security.googleblog.com
...match process_response(unsafe { slice::from_raw_parts(dns_response, response_len) }) { Ok(()) => 0, Err(err) => err.into(), } } fn process_response(response: &[u8]) -> Result<()> { let response = hickory_proto::op::Message::from_bytes(response)?; let response = hickory_proto::xfer::DnsResponse::from_message(response)?; for answer in response.answers() { match answer.record...
Rust Walkthroughs 2026-04-15 ~8 min read
slint-ui.com
...This matches the layout produced by a native Qt application much better and fixes the gallery demo with native style: The "Button (checkable)" GroupBox is much wider with this change -- much like a similar UI looks in Qt designer. Janitor work Fix Node tests in the CI (#1435) After commit...
Project/Tooling Updates 2022-08-03 ~1 min read
"If Rust is martial arts teacher, Perl is a pub brawler. If you survive either, you’re likely to be good at defending yourself, though both can be pa..."

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.
Put ! first to open the top result immediately. Quote the whole query for a literal leading bang, as in '!Send'. Bangs elsewhere, such as println!, stay literal. Browser and launcher shortcuts can invoke this directly. See search integrations.
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.