rust-analyzer.github.io
...type mismatch with associated types.
#12427 fix VSCode config patching incorrectly patching some configs.
#12444 implement parsing of ? opt-out trait bounds.
#12467 fix Match to if-let assist for wildcard patterns.
#12470, #12472 avoid duplicating output channels when restarting the server.
#12471 restart the server instead of reloading the...
Project/Tooling Updates
2022-06-08
~1 min read
notes.iveselov.info
...if $s matched our tokens without trailing semicolon, won't it be logical to add that semicolon in the expansion part to compensate?The reason that it doesn't work like that is as follows. When we expand the macro, matched $s is not a token stream anymore! Since its...
News & Blog Posts
2020-05-12
~6 min read
thume.ca
...Instead of using data tables like in the canonical Pratt parser implementation, we used Rust functions with match statements, which fill the same purpose but with more power and no need to keep a data structure around:
fn binding_power(cur: &SpannedToken) -> Option<u8> {
match &cur.tok {
Token::Operator(op...
News & Blog Posts
2019-05-28
~15 min read
poignardazur.github.io
...foobar(my_a, my_b);
The type system takes the types of my_a and my_b, and finds the least restrictive qualifier that matches both these types. inout becomes that qualifer.
For instance, if my_a is const int* and my_b is int*, inout “becomes” const, and the...
Observations/Thoughts
2022-01-12
~4 min read
rustc-dev-guide.rust-lang.org
...Prefer exhaustive matches
Using _ in a match is convenient, but it means that when new variants are added to the enum, they may not get handled correctly. Ask yourself: if a new variant were added to this enum, what's the chance that it would want to use the _ code...
Guide to Rustc Development
Book
2024-01-01
~4 min read
www.rsarai.xyz
...use std::path::Path;
use std::fs::File;
use std::io::prelude::*;
fn load_documents(path_str: &str) {
// Create a path to the desired file
let path = Path::new(&path_str);
let display = path.display();
// Open the path in read-only mode, returns `io::Result<File>`
let mut file = match...
Rust Walkthroughs
2022-05-18
~7 min read
rust-lang-nursery.github.io
...badge]][cat-text-processing] | | Extract phone numbers from text | [![regex-badge]][regex] | [![cat-text-processing-badge]][cat-text-processing] | | Filter a log file by matching multiple regular expressions | [![regex-badge]][regex] | [![cat-text-processing-badge]][cat-text-processing] | Replace all occurrences of one text pattern with another pattern. | [![regex-badge...
The Rust Cookbook
Book
2024-01-01
~1 min read
guillaumegomez.github.io
...and added ‘platform-specific’ section to sleep_ms to match sleep..
@jmdyck added a link to the second edition of The Book.
@steveklabnik fixed wording around sort guarantees.
@estebank taught diagnostics to highlight text and provided disambiguated syntax for candidates in E0034.
@APTy added docs and tests for join_multicast...
Other Weeklies from Rust Community
2017-01-17
~2 min read
aminediro.com
...Traditionally, text search is usually done using some kind of exact matching or fuzzy matching algorithm with some sprinkled clever pre/post processing techniques like stemming, and lemmatization… All it can do is to check, at scale, whether a query matches some text and return the result. The big downside...
Observations/Thoughts
2024-01-17
~17 min read
mobiarch.wordpress.com
...fn make_dir(path: &str) -> std::io::Result<()> {
let err = match std::fs::create_dir(path) {
Ok(_) => return Ok(()),
Err(e) => e
};
match err.kind() {
ErrorKind::AlreadyExists => return Ok(()),
_ => {
println!("Failed to create directory: {}", path);
return Err(err);
}
};
}
getenv
Use std::env:var.
if let Ok(val) = std::env::var...
From the Blogosphere
2015-07-13
~2 min read
www.redox-os.org
...The public key must match the
one installed on disk. The signature of the struct must verify against the
public key. If this is true, the hash and entry count are considered valid.
The entry metadata can now be downloaded to a temporary file. During the
download, the BLAKE3 hash...
News & Blog Posts
2020-03-17
~5 min read
ryhl.io
...In the example above, we match on the enum inside a handle_message method on
the actor struct, but that isn't the only way to structure this. One could also
match on the enum in the run_my_actor function. Each branch in this match
could then call various...
Rust Walkthroughs
2021-02-17
~11 min read
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