docs.rs
...For full details read the docs on docs.rs This crate provides helper types for matching against enum variants, and extracting bindings to each of the fields in the deriving Struct or Enum in a generic way. If you are writing a #[derive] which needs to perform some operation on...
Crate
v0.14.0
2026-07-30
rustc-dev-guide.rust-lang.org
...This means that matching on TyKind can easily be incorrect.
We handle normalization in two different ways. When proving Trait goals when normalizing associated types, we separately assemble candidates depending on whether they structurally match the self type. Candidates which match on the self type are handled in EvalCtxt::assemble...
Guide to Rustc Development
Book
2024-01-01
~2 min read
doc.rust-lang.org
...fn main() {
match a {
_ =>
// comment with =>
{
println!("A")
}
}
}
Style edition 2024:
fn main() {
match a {
_ =>
// comment with =>
{
println!("A")
}
}
}
Multiple inner attributes in a match expression indented incorrectly
Multiple inner attributes in a match expression were being indented incorrectly.
Style edition 2021:
pub fn main() {
match a {
#![attr1]
#![attr2]
_ => None...
The Rust Edition Guide
Book
2024-01-01
~7 min read
niedzejkob.p4.team
...non-exhaustive patterns: `(Some(_), Some(_))` not covered
--> example.rs:4:11
|
4 | match (old_thing, new_thing) {
| ^^^^^^^^^^^^^^^^^^^^^^ pattern `(Some(_), Some(_))` not covered
|
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
= note: the matched value is of type `(Option<Thing>, Option<Thing...
Observations/Thoughts
2021-07-21
~8 min read
docs.rs
...let status = reqwest::get(format!("{}/missing", &mock_server.uri())) .await .unwrap() .status(); assert_eq!(status.as_u16(), 404); } Matchers wiremock provides a set of matching strategies out of the box - check the matchers module for a complete list. You can define your own matchers using the Match trait, as well...
Crate
v0.6.5
2025-08-24
rust-analyzer.github.io
#10519 (first contribution) set toolinfo in LSIF export.
#10522 (first contribution) fix serialization of SignatureHelp response.
#10534 (first contribution) improve logo rendering on dark backgrounds.
#10538 (first contribution) make brace matching prefer the one to the right of the cursor.
#10542 (first contribution) use workspace cargo to fetch rust-src...
Project/Tooling Updates
2021-10-20
~1 min read
mrtact.medium.com
...The clunkiness of having to match everything against a Result, only to then re-wrap each output in the correct variant, completely obscures the beauty of that match expression. I mean, seriously, look at it! Not blowing my own horn — I didn’t have to be all that smart to...
Rust Walkthroughs
2021-01-20
~3 min read
doc.rust-lang.org
...Condition operands must be either an [Expression] with a boolean type or a conditional let match.
If all of the condition operands evaluate to true and all of the let patterns successfully match their scrutinees, the consequent block is executed and any subsequent else if or else block is skipped...
The Rust Reference
Book
2024-01-01
~4 min read
www.jacobelder.com
← Back to all posts
One of the things I really like about Rust is its match expressions. Plenty of other languages like Ruby, Python, and Haskell have similar features, but it’s painfully absent in popular languages like JavaScript. There, we have only switch...case. That statement is not exhaustive...
Rust Walkthroughs
2024-02-28
~7 min read
crates.io
...The actual results will vary depending on the inputs, but here is a taster based on "a".repeat(40) as an input and various modes (nothing matched, everything matched and replaced, everything matched from the start and deleted): params .replace (ns) .cow_replace (ns) difference (%) ("a", "") 408.59 290.27...
Crate
v0.1.3
2023-09-26
docs.rs
...BuildMetadata::EMPTY, }; assert!(!req.matches(&version)); // Check whether it matches 1.3.0 (yes it does) let version = Version::parse("1.3.0").unwrap(); assert!(req.matches(&version)); } Scope of this crate Besides Cargo, several other package ecosystems and package managers for other languages also use SemVer: RubyGems/Bundler for...
Crate
v1.0.28
2026-04-04
docs.sru-systems.com
...use argon2::{self, Config}; let password = b"password"; let salt = b"randomsalt"; let config = Config::default(); let hash = argon2::hash_encoded(password, salt, &config).unwrap(); let matches = argon2::verify_encoded(&hash, password).unwrap(); assert!(matches); Create a password hash with custom settings and verify it: use argon2::{self, Config, ThreadMode...
Crate
v3.0.0
2025-07-17
kerkour.com
...u64) {
let timeout = Duration::from_secs(timeout);
let socket_address = SocketAddr::new(target.clone(), port);
match tokio::time::timeout(timeout, TcpStream::connect(&socket_address)).await {
Ok(Ok(_)) => println!("{}", port),
_ => {}
}
}
Extreme concurrency
If you are a recurrent reader of this blog you should have guessed the perfect concurrency primitive for the...
Rust Walkthroughs
2021-08-18
~3 min read
blog.pnkfx.org
...use of moved value: `matches`
--> src/lib.rs:11:36
|
8 | fn print_count(matches: Matches, opts: Options) {
| ------- move occurs because `matches` has type `Matches`, which does not implement the `Copy` trait
9 | match opts.max {
10 | Some(n) if matches.count() > n => print!("{}{}", n, opts.separator),
| ------- value moved here...
News & Blog Posts
2019-07-02
~33 min read
crates.io
Emulate macro-rules pattern matching in procedural macros proc-macro-rules macro_rules -style syntax matching for procedural macros. This crate is work-in-progress, incomplete, and probably buggy! Example: rules!(tokens => { ($finish:ident ($($found:ident)*) # [ $($inner:tt)* ] $($rest:tt)*) => { for f in found { do_something(finish, f, inner, rest...
Crate
v0.4.0
2023-11-07
doc.rust-lang.org
primitive i128
...i128 is intended to always match __int128 and does not attempt to match _BitInt(128) on platforms without __int128.
primitive
core
Stable since 1.26.0
Version 1.100.0-nightly
doc.rust-lang.org
primitive i128
...i128 is intended to always match __int128 and does not attempt to match _BitInt(128) on platforms without __int128.
primitive
std
Stable since 1.26.0
Version 1.100.0-nightly
github.com
...These fragment specifiers define what Rust syntax will be matched and bound to each metavariable. For example, the `item` fragment specifier matches an [item][], `block` matches a [block expression][], `expr` matches an [expression][], and so on.
As we add new features to Rust, sometimes we change its syntax. This means...
RFC 3531
RFC
2023-11-16
~7 min read
crates.io
Unicode caseless matching rust-caseless Unicode caseless matching
Crate
v0.2.2
2024-12-30