github.com
...like this:
```Rust
if input > max {
max
}
else if input < min {
min
} else {
input
}
```
and
```Rust
input.max(min).min(max);
```
and even
```Rust
match input {
c if c > max => max,
c if c < min => min,
c => c,
}
```
Typically these patterns exist where there is a need to interface with...
RFC 1961
RFC
2017-03-26
~2 min read
tokio.rs
...let api_router = Router::new()
.route("/users", get(|| { ... }))
.fallback(api_fallback);
let app = Router::new()
// this would panic since `api_router` has a fallback
.nest("/api", api_router);
However in 0.6 that now just works and requests that start with /api but
aren't matched by api_router will...
Project/Tooling Updates
2022-11-30
~6 min read
rustc-dev-guide.rust-lang.org
...FileCheck best practices
See LLVM FileCheck guide for details.
• Avoid matching on specific register numbers or basic block numbers unless they're special or critical for the test. Consider using patterns to match them where suitable.
TODO
Pending concrete advice.
Guide to Rustc Development
Book
2024-01-01
~6 min read
blog.gokuls.in
...filter matches the files you changed.
None of that was part of the original plan. It just kept happening the way side projects usually do. I'd hit some gap between "works on GitHub" and "doesn't work locally," get annoyed by it, and then go build the missing piece...
Observations/Thoughts
2026-05-20
~6 min read
encore.dev
...When you declare an API, a database, a Pub/Sub topic, or a cache, the declaration is ordinary TypeScript, and Encore reads the source to find those declarations and the request and response types attached to them, then provisions the infrastructure to match. We do that reading with a parser...
Observations/Thoughts
2026-07-15
~6 min read
www.sea-ql.org
...impl Iden for Glyph { - fn unquoted(&self, s: &mut dyn fmt::Write) { + fn unquoted(&self) -> &str { - write!( - s, - "{}", match self { Self::Table => "glyph", Self::Id => "id", Self::Tokens => "tokens", } - ) - .unwrap(); }}
Possible compile errors
error[E0050]: method `unquoted` has 2 parameters but the declaration in trait `types::Iden::unquoted` has 1...
Project/Tooling Updates
2026-01-14
~5 min read
blog.sheerluck.dev
...The only prerequisite is that you have read the previous articles in this series, as I will assume you know ownership, borrowing, structs, enums, pattern matching, error handling, generics, traits, lifetimes, HashMap, iterators, and closures.
Get the source code from here
What is a Smart Pointer
A pointer is a...
Rust Walkthroughs
2026-06-10
~25 min read
guillaumegomez.github.io
...non-self arguments of bare functions and struct methods on their own line.
@pmatos improved documention troubleshooting missing linker.
@kmcallister updated Arc docs to match new Rc docs.
@japaric implemented –sysroot on rustdoc.
@liigo updated rustdoc to inline sidebar items, to display more in a page.
@giannicic fixed E0520 error...
New Crates & Project Updates
2016-09-27
~2 min read
felix-knorr.net
...Uri| async move {
match make_https(host, uri) {
Ok(uri) => Ok(Redirect::permanent(&uri.to_string())),
Err(e) => {
Err(StatusCode::BAD_REQUEST)
}
}
};
// Change to match where your app is hosted
let addr = SocketAddr::from(([0, 0, 0, 0], 80));
let listener = tokio::net::TcpListener::bind(addr).await.unwrap();
axum::serve...
Observations/Thoughts
2024-10-16
~12 min read
www.worthe-it.co.za
...I only want to handle the
// case where it's empty, meaning it's a normal new commit with no
// special message-related arguments (not -m)
let commit_source = env::args().nth(2);
let current_branch = get_current_branch();
match (current_branch, commit_filename, commit_source) {
(Ok(branch), Some(filename...
News & Blog Posts
2017-09-05
~10 min read
github.com
...In the absence of
`catch`, we would have to suggest the introduction of a `match` block.
**Extended error message text.** In the extended error message, for
those cases where the return type cannot easily be changed, we might
consider suggesting that the fallible portion of the code is
refactored into...
RFC 1859
RFC
2017-01-19
~14 min read
richer-richard.github.io
...Verify — an assertion DSL over a render (true_peak_below,
pitch_matches_score, tempo_is, …), so an agent can retry on a
failed assertion instead of asking a human “does that sound right?”
Every crate here works standalone. cochlea probe runs on any WAV,
FLAC, mp3, or ogg file with...
Project/Tooling Updates
2026-07-15
~2 min read
blog.jfo.click
...I could assign that
result to a local var and handle each case explicitly using a match statement...
use std::fs::{File};
fn main() {
let result = File::open("file_that_doesnt_exist.lol");
match result {
Ok(v) => println!("success opening file :) {:?}", v),
Err(e) => println!("error opening file!!!: {:?}", e),
}
println...
Blog Posts
2016-10-18
~38 min read
rolisz.ro
...lower values will give hints that are closer to the words, but they will match fewer words, higher values will match more words, potentially worse. impl Spymaster for DoubleHintVectorSpymaster<'_> {
fn give_hint(&mut self, map: &Map) -> Hint {
let enemy_color = opposite_player(self.color);
let remaining_words = map.remaining_words...
Learn More Rust
2020-09-30
~9 min read
seanmonstar.com
...I wrote a proposal for a forwards-compatible Body trait, and published an article as a preface to the pattern matching compatibility issues being solve in that proposal.
For additions, I added version-specific Connection types for the client, to replace the “either-version” type already there. We also put...
Project/Tooling Updates
2022-08-31
~2 min read
quan.hoabinh.vn
...Remember to choose the one that matches your device flash size.
After downloading, rename the file as partitions.csv and save in your top-level folder of the code base. Later, when flashing the firmware, add --partition-table option to espflash command. For example, in my case, it will be...
Observations/Thoughts
2024-04-03
~9 min read
fly.io
...Rust is big on pattern-matching; instead of control flow based (at bottom) on simple arithmetic expressions, Rust allows you to match exhaustively (with compiler enforcement) on the types of an expression, and the type system expresses things like Ok or Err.
But match can be cumbersome, and so there...
Observations/Thoughts
2025-06-04
~18 min read
rustacean-station.org
...II
Pointers Are Complicated III
53:43 - Safe items with unsafe extern
59:32 - Unsafe attributes
1:03:44 - Omitting empty types in pattern matching
The never type
1:11:33 - Floating-point NaN semantics and const
1:17:41 - Constants as assembly immediates
1:19:06 - Safely addressing unsafe...
Observations/Thoughts
2025-10-29
~2 min read
llogiq.github.io
...There’s a blanket
Into<T> impl for each T with a matching From<_> implementation, so if you
are a library author, you should consider implementing From<_> for your types
and only resort to Into<_> implementations for types you cannot implement
From for because of the orphan rule (which is...
News & Blog Posts
2015-11-30
~6 min read
monadical.com
...Cursor,
) -> (event::Status, Option<Curve>) {
let cursor_position =
if let Some(position) = cursor.position_in(&bounds) {
position
} else {
return (event::Status::Ignored, None);
};
match event {
Event::Mouse(mouse_event) => {
let message = match mouse_event {
mouse::Event::ButtonPressed(mouse::Button::Left) => {
match *state {
None => {
*state = Some(Pending::One {
from: cursor_position...
Rust Walkthroughs
2023-05-03
~45 min read