rust-analyzer.github.io
...10264 don’t seek outside of character boundaries in completion handler.
#10260 fix name generation in "Generate function" assist.
#10267 narrow if-let to match assist range.
#10282 don’t allow two turbo-fishes in generic arguments.
#10289 only strip derive attributes when preparing macro input.
#10293 don’t bail...
Project/Tooling Updates
2021-09-22
~1 min read
www.rustydonkey.dev
...All the same numeric comparisons are supported here too!
Text Matching: This one is really cool! You can find text that:
is exactly a certain string
starts with a substring
ends with a substring
contains a substring
Hierarchy: You can now also filter directly by an item's class and...
Project/Tooling Updates
2025-10-29
~4 min read
felix-knorr.net
...So I needed to transform my handler
functions so that their return type matches. In Python I would've used a
decorator function for that:
def eat_error(f):
def inner(*args, **kwargs):
return some_transformation(f(*args, **kwargs))
return inner
And I knew that there was this one type...
Rust Walkthroughs
2022-10-19
~6 min read
rust-analyzer.github.io
...broken code.
#14920 fix edits for convert_named_struct_to_tuple_struct.
#14950 support floating-point intrinsics in const eval.
#14951 fix string pattern matching in mir interpreter.
#14955 remove unnecessary StorageDead.
#14961 fix drop scopes problems in mir.
#14970 detect multiple bindings for one identifier in the same pattern...
Project/Tooling Updates
2023-06-07
~1 min read
hirrolot.github.io
...for S<Lhs> is the induction step
(recursion case) – similar to how we did with pattern matching using
match. Likewise, as in the first example, the induction
works by reducing the first argument to Z:
<Lhs as Add<Rhs>>::Result works just like
add(next, rhs) – it invokes pattern matching...
Observations/Thoughts
2022-01-26
~30 min read
blog.jetbrains.com
...When the output is not what you expected, it can be hard to see how the input matches the macro definition and what code the macro produced.
The new interactive declarative macro tester shows you the code your macro input expands into, as well as how the input and output...
Project/Tooling Updates
2026-07-22
~4 min read
rust-analyzer.github.io
#11894 (first contribution) complete pattern args based on type name
#11891 show error message when flycheck fails.
#11915 attempt to heuristically resolve paths in const arguments in IDE layer.
#11953 make extract_module more lazy.
#11896 show path to be created in the unresolved-module fix label.
#11899 skip match...
Project/Tooling Updates
2022-04-13
~1 min read
minikin.me
...Presence<T>) {
match update {
Presence::Absent => {}, // Field missing from JSON → no change
Presence::Null => *target = None, // Field is null in JSON → clear
Presence::Some(v) => *target = Some(v), // Field has value → set it
}
}
fn apply_patch(user: &mut User, patch: UserPatch) {
apply_field(&mut user.name, patch.name);
apply_field...
Rust Walkthroughs
2025-12-17
~7 min read
arzg.github.io
...Let’s add a todo!() and comment out the rest so we can get on with running our tests:impl Expr {
// snip
pub(crate) fn eval(&self, env: &Env) -> Result<Val, String> {
match self {
Self::Number(Number(n)) => Ok(Val::Number(*n)),
Self::Operation { lhs, rhs, op } => {
todo!();
// let Number...
Learn More Rust
2020-10-14
~25 min read
docs.rs
...ChannelBuilderError> { Ok(Channel { id: match self.id { Some(ref value) => Clone::clone(value), None => { return Err( Into::into( ::derive_builder::UninitializedFieldError::from("id"), ), ) } }, token: match self.token { Some(ref value) => Clone::clone(value), None => { return Err( Into::into( ::derive_builder::UninitializedFieldError::from("token"), ), ) } }, special_info: match self.special_info { Some...
Crate
v0.20.2
2024-10-08
adventures.michaelfbryan.com
...std::slice::Iter<'src, Operation>,
}
Turning TextObjectParser into an Iterator turned out to be pretty easy
thanks to pattern matching. I know ahead of time exactly which operations
I’m looking for and what their operands will be so each pattern can be its
own branch in a big match...
Rust Walkthroughs
2021-02-03
~13 min read
doc.rust-lang.org
fn source(&self) -> Option<&dyn Error + 'static>
...SuperErrorSideKick })
}
fn main() {
match get_super_error() {
Err(e) => {
println!("Error: {e}");
println!("Caused by: {}", e.source().unwrap());
}
_ => println!("No error"),
}
}
method
core
Stable since 1.30.0
Version 1.100.0-nightly
malachite.rs
...The current floating-point string conversion functions are incomplete and will be changed in the future to match MPFR's behavior. Malachite is developed by Mikhail Hogrefe. Thanks to 43615, b4D8, Romain Billot, Maxim Biryukov, coolreader18, Dasaav-dsv, Duncan Freeman, florian1345, konstin, Rowan Hart, YunWon Jeong, Park Joon-Kyu, Antonio...
Crate
v0.10.0
2026-07-27
dev.to
...diesel::result::Error, context: &str) -> AppError {
AppError::new(
format!("{}: {}", context, err.to_string()).as_str(),
match err {
diesel::result::Error::DatabaseError(db_err, _) => {
match db_err {
diesel::result::DatabaseErrorKind::UniqueViolation => ErrorType::BadRequest,
_ => ErrorType::Internal,
}
}
diesel::result::Error::NotFound => ErrorType::NotFound,
// Here we can handle other cases if needed
_ => {
ErrorType::Internal...
Learn More Rust
2020-08-04
~20 min read
matthewkmayer.github.io
...database_instance_name.to_string(),
db_instance_class: "db.t2.micro".to_string(),
// name and login details should match `.env` in rusoto-rocket
master_user_password: Some("TotallySecurePassword501".to_string()),
master_username: Some("masteruser".to_string()),
db_name: Some("rusotodb".to_string()),
engine: "postgres".to_string(),
multi_az: Some(false...
News & Blog Posts
2017-05-23
~9 min read
doc.rust-lang.org
pub struct IntoInnerError<W>
...let stream = match stream.into_inner() {
Ok(s) => s,
Err(e) => {
// Here, e is an IntoInnerError
panic!("An error occurred");
}
};
struct
alloc
Stable since 1.0.0
Version 1.100.0-nightly
traxys.me
...We need to be careful when categorizing arguments, as we don't want --foo to match a short argument, nor do we want -- to match a long argument.
The reason for introducing a ShortArgument structure is that short arguments are inherently ambiguous.
-abc could be parsed as either -a -b...
Project/Tooling Updates
2024-10-02
~15 min read
fasterthanli.me
...2
Match arms are patterns
match arms are also patterns, just like if let:
fn print_number(n: Number) {
match n {
Number { odd: true, value } => println!("Odd number: {}", value),
Number { odd: false, value } => println!("Even number: {}", value),
}
}
// this prints the same as before
Exhaustive matches
A match has to be...
News & Blog Posts
2020-03-03
~31 min read
rust-analyzer.github.io
...pattern_analysis to fix a panic on mismatched types.
#16770 fix panic on float numbers without dots in chain calls (x.1e0).
#16779 skip match diagnostics for partially unknown types.
#16690 use four-space indentation in macro expansion.
#16752 don’t allow destructuring of structs with no public fields.
#16766...
Project/Tooling Updates
2024-03-13
~1 min read