17:27
New Rustacean
newrustacean.com
Episode: News: Rust 1.26
impl trait, match on references, Results from main, and more. A good way to mark three years since Rust 1.0! Show Notes Rust 1.26: blog post release notes RFC #2115 The Rusty Spike webassembly.studio burntsushi’s now-1.0 crates: regex csv docopt Search crates VS Code...
Podcast
2018-05-15
17:27
smallcultfollowing.com
...with Thin Traits, you write virtual methods
whereas with Extensible Enums, you write match statements – and I
think match statements are far more common in Rust today.Still, Thin Traits will be a very good fit for various use cases.
They are a good fit for Servo, for example, where...
News & Blog Posts
2015-10-12
~15 min read
codeandbitters.com
...let value = rand::thread_rng().gen();
Self { value }
}
}
Match Ergonomics pattern changes §
Lint: rust-2024-incompatible-pat
Rust edition guide: Match ergonomics reservations
I found this change tricky. I was starting off at a disadvantage, because I didn't know what "match ergonomics" or "binding mode" meant. So the warnings...
Observations/Thoughts
2025-02-12
~18 min read
crates.io
...How to get a compatible version of protoc The protoc binary that you use to generate code needs to have a version that exactly matches the version of the protobuf crate you are using. More specifically, if you are using Rust protobuf x.y.z then you need to use...
Crate
v4.36.2-release
2026-09-17
zupzup.org
...i32,
) -> Result<Vec<Bytes>> {
let https = HttpsConnector::new()?;
let client = Client::builder().build::<_, hyper::Body>(https);
let group = config.group.as_ref();
let user = config.user.as_ref();
let uri = match group {
Some(v) => format!(
"https://gitlab.com/api/v4/groups/{}/{}?per_page={}",
v, domain, per_page
),
None => match user...
News & Blog Posts
2019-11-26
~10 min read
doc.rust-lang.org
pub fn next_if_map<R>(&mut self, f: impl FnOnce(<I as >::Item) -> Result<R, <I as >::Item>) -> Option<R>
...let mut iter = "125 GOTO 10".chars().peekable();
let mut line_num = 0_u32;
while let Some(digit) = iter.next_if_map(|c| c.to_digit(10).ok_or(c)) {
line_num = line_num * 10 + digit;
}
assert_eq!(line_num, 125);
assert_eq!(iter.collect::<String>(), " GOTO 10");
Matching custom...
method
core
Stable since 1.94.0
Version 1.100.0-nightly
doc.rust-lang.org
...Storing Matching Lines
To finish this function, we need a way to store the matching lines that we want to return. For that, we can make a mutable vector before the for loop and call the push method to store a line in the vector. After the for loop, we...
The Rust Programming Language
Book
2024-02-01
~6 min read
crates.io
...std::iter::Iterator<Item = <A as std::iter::Iterator>::Item>, { type Item = <A as std::iter::Iterator>::Item; fn next(&mut self) -> Option<Self::Item> { match self { Enum::A(x) => x.next(), Enum::B(x) => x.next(), } } fn size_hint(&self) -> (usize, Option<usize>) { match self { Enum::A(x) => x...
Crate
v0.16.0
2026-07-24
phildawes.net
...uint,
callback: &mut |Match|) {
...
}
complete_from_file("foo", "myfile.rs", 3, |match| {
// do something with each match
});
This means the whole search happens regardless of whether you just want the first match. The main reason for doing this is because iterators are somewhat less easy to write for my brain...
Community Updates
2014-05-17
~5 min read
dimforge.com
...shape-matching, constraints,
and the Finite Elements Method (FEM).
Shape-matching
Main reference: Meshless deformations based on shape matching (Müller, et al.)
Shape-matching is the simplest approach that only needs the soft-body mass points to work (no need for edges or cells).
It is good for sets of...
Observations/Thoughts
2026-09-30
~18 min read
doc.rust-lang.org
pub fn div_euclid(self, rhs: f32) -> f32
f32::div_euclid — Calculates Euclidean division, the matching method for rem_euclid.
This computes the integer n such that self = n * rhs + self.rem_euclid(rhs). In other words, the result is self / rhs rounded to the integer n such that self >= n * rhs.
Precision
The result of this operation...
method
std
Stable since 1.38.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn div_euclid(self, rhs: f64) -> f64
f64::div_euclid — Calculates Euclidean division, the matching method for rem_euclid.
This computes the integer n such that self = n * rhs + self.rem_euclid(rhs). In other words, the result is self / rhs rounded to the integer n such that self >= n * rhs.
Precision
The result of this operation...
method
std
Stable since 1.38.0
Version 1.100.0-nightly
docs.rs
rapid fuzzy string matching library Rapid fuzzy string matching in Rust using the Levenshtein Distance Description • Installation • Usage • License Description RapidFuzz is a general purpose string matching library with implementations for Rust, C++ and Python. Key Features Diverse String Metrics : Offers a variety of string metrics to suit different use...
Crate
v0.5.0
2023-12-01
xnacly.me
...Rust makes this enjoyable via the matches! macro and the patterns the
match statement accepts. For instance, checking if the current character is
a valid sqlite number can be done by a simple matches! macro invocation:RUST 1/// Specifically matches https://www.sqlite.org/syntax/numeric-literal.html
2fn is...
Rust Walkthroughs
2024-11-06
~18 min read
www.huy.rocks
...to get the current token
is_match(): to check if the current token matched the expected type or not
advance(): to consume the current token and move on to the next
These methods are not exclusive to a recursive descent parser, but they’re very helpful, as they keep the...
Rust Walkthroughs
2022-05-11
~6 min read
rust-lang.github.io
Summary
Provide a simple model describing three kinds of structs and variants and their relationships.Provide a way to match on structs/variants in patterns regardless of their kind (S{..}).Permit tuple structs and tuple variants with zero fields (TS()).
Motivation
There's some mental model lying under the current...
RFC 1506
RFC
2016-02-07
~5 min read
crates.io
...They're efficient and convenient for matching events or defining hardcoded keybindings. match key_event.into() { key!(ctrl-c) => { println!("Arg! You savagely killed me with a {}", fmt.to_string(key_event).red()); break; } key!(ctrl-q) => { println!("You typed {} which gracefully quits", fmt.to_string(key_event).green()); break...
Crate
v1.5.1
2026-10-17
doc.rust-lang.org
pub const fn is_err_and<F>(self, f: F) -> bool
Result::is_err_and — Returns true if the result is Err and the value inside of it matches a predicate.
Examples
use std::io::{Error, ErrorKind};
let x: Result<u32, Error> = Err(Error::new(ErrorKind::NotFound, "!"));
assert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), true);
let x...
method
core
Stable since 1.70.0
Version 1.100.0-nightly
rust-analyzer.github.io
...for fill_match_arms with local enums.
#11795 correctly suggest auto importing traits from aliases.
#11791 fix and improve signature help.
#11802 add stubs to make proc macros work that use the SourceFile API.
#11825 don’t complete Drop::drop for qualified paths.
#11831 disable ref_match for qualified paths...
Project/Tooling Updates
2022-03-30
~1 min read
fredrik.anderzon.se
...It will print the todos only for the matching filter. We've broken out printing of a single todo item to a print_todo function so that it's easy to call it in several branches of our match statement.
Matching on enums is very straight forward as you can...
News & Blog Posts
2016-06-27
~25 min read