www.meilisearch.com
...enable equality operators for exact matching, while disabling unused features such as comparison operators and facet search.
This targeted configuration can notably boost indexing performance.
Experimental: composite embedders
Meilisearch 1.14 introduces a new experimental feature that lets you use different embedders at search and indexing time, allowing you to...
Project/Tooling Updates
2025-04-16
~3 min read
rustc-dev-guide.rust-lang.org
...This prevents users from using an impl which is entirely covered by a where-bound, matching the behavior of the old implementation and avoiding some weird errors, e.g. trait-system-refactor-initiative#76.
NormalizesTo goals are a function
See the normalization chapter. We replace the expected term with an...
Guide to Rustc Development
Book
2024-01-01
~3 min read
laurmaedje.github.io
...u64) -> u64 {
match n {
0 => 0,
1 => 1,
n => fib(n-1) + fib(n-2),
}
}
In its naive recursive variant, executing this function takes
exponential time. With memoization, however, each unique call to
fib will be evaluated just once. This way, we can cut the
running time down from exponential...
Observations/Thoughts
2022-10-19
~8 min read
arstechnica.com
...They also often introduce issues when using old C or C++ libraries—often desirable because so much existing code uses these languages—and so special care has to be taken when mixing and matching.
Languages such as Java, C#, and JavaScript also do not use native code, instead tending to...
Notable Links
2015-05-18
~3 min read
github.com
...Rather, the trait matching
system implicitly instantiates impls as part of trait matching. This
implies that all type parameters are always instantiated with type
variables. These type variables are assigned fallbacks according to
the defaults given.
### Type variables with fallbacks
We extend the inference system so that when a type...
RFC 213
RFC
2015-02-04
~18 min read
www.lpalmieri.com
...a GET request to /home/1 will match with both!
But the request handler will fail to extract route parameters from /home/:id if you forget to change the field name in HomeRouteParams from home_id to id. Even worse, the failure will happen at runtime—if there are no...
Project/Tooling Updates
2023-04-26
~12 min read
github.com
...The specific
declarative syntax using pattern matching and templating is often referred to as
'macros by example'.
'Pattern macro' has been suggested as an alternative for 'declarative macro'.
## Drawbacks
[drawbacks]: #drawbacks
There is a risk that `macro_rules!` is good enough for most users and there is
low adoption of...
RFC 1584
RFC
2016-04-17
~3 min read
doc.rust-lang.org
...or raw pointer that has invalid metadata:
• dyn Trait metadata is invalid if it is not a pointer to a vtable for Trait that matches the actual dynamic trait the pointer or reference points to
• slice metadata is invalid if the length is not a valid usize (i.e., it...
The Rustonomicon
Book
2024-01-01
~3 min read
romankudryashov.com
...Request<PlanetRequest>,
) -> Result<Response<PlanetResponse>, Status> {
debug!("Got a request: {:?}", request);
let planet_name = request.into_inner().name;
let planet =
persistence::repository::get_by_name(&planet_name, &get_connection(&self.pool));
match planet {
Ok(planet) => {
let planet = PlanetWrapper {
planet: planet.0,
satellites: planet.1,
}
.into();
let reply = PlanetResponse {
planet: Some...
Rust Walkthroughs
2021-04-28
~7 min read
hsivonen.fi
...Let’s have it for plain if and address match and if let once there actually is a workable design for those.
No LTS
Rust has successfully delivered on “stability without stagnation” to the point that Red Hat delivers Rust updates for RHEL on a 3-month frequency instead of...
Call for Blog Posts
2020-09-16
~3 min read
blog.infinitenegativeutility.com
...I think that it adds an extra hurdle to learnability1, it obscures the (incredibly simple!) way that Rust's error-handling works, it produces an unfortunate asymmetry between producing Result values (where the shape of the data is implied by the context) and matching on Result values (where you will...
News & Blog Posts
2018-06-05
~8 min read
developerlife.com
...Some(#margin_int),
}
}
None => quote! {},
};
let maybe_color_fg_expr = match color_fg {
Some(color_expr) => {
quote! {
color_fg: Some(crossterm::style::#color_expr.into()),
}
}
None => quote! {},
};
let maybe_color_bg_expr = match color_bg {
Some(color_expr) => {
quote! {
color_bg: Some(crossterm::style::#color_expr.into()),
}
}
None => quote! {},
};
quote...
Rust Walkthroughs
2023-06-07
~16 min read
purplesyringa.moe
...0 };
for ch in &self.slice[..i] {
match *ch {
b'\n' => {
position.line += 1;
position.column = 0;
}
_ => {
position.column += 1;
}
}
}
position
}
…which is called from position() to format the error, which is documented as:/// Position of the most recent call to next().
///
/// ...
///
/// Only called in case of an error, so...
Observations/Thoughts
2024-08-28
~18 min read
moletrooper.github.io
...for mut body in g.l_body.iter_mut(&g.graph) {
let tr = match g.graph.get_neighbor(&body, &g.l_transform) {
Some(tr) => tr,
None => continue,
};
let coll = match graph.get_neighbor(&body, &g.l_collider) {
Some(c) => c,
None => continue,
};
// ...do stuff with `body`, `tr` and `coll`!
}
// note...
Observations/Thoughts
2020-09-04
~22 min read
bitfieldconsulting.com
...You can call C libraries from Rust, or mix and match C++
components with Rust packages.
Overall, Rust sits neatly in the “best of both worlds” space between
garbage-collected memory-safe languages like Go, and high-performance,
close-to-the-metal languages like C++.
Happy, productive developers
Okay, Rust...
Observations/Thoughts
2026-02-11
~8 min read
github.com
...After [src/grammar] transitions into this state, for any discovered discrepancies the
rustc parser implementation must be adjusted to match the [src/grammar], unless decided otherwise
by the RFC process.
### RFC process changes for syntactic changes and additions
Once the [src/grammar] enters semi-canonical state, all RFCs must describe...
RFC 1331
RFC
2015-10-21
~3 min read
doc.rust-lang.org
...base}; // OK, only base.x is accessed
drop(y_ref);
Struct expressions can't be used directly in a loop or if expression's head, or in the scrutinee of an if let or match expression. However, struct expressions can be used in these situations if they are within another...
The Rust Reference
Book
2024-01-01
~3 min read
developerlife.com
...let (tcp_stream, socket_addr) = tcp_listener.accept().await?;
let tx = tx.clone();
tokio::spawn(async move {
let result = handle_client_task(tcp_stream, tx, socket_addr).await;
match result {
Ok(_) => {
log::info!("handle_client_task() terminated gracefully")
}
Err(error) => log::error!("handle_client_task() encountered error: {}", error),
}
});
}
}
To run...
Rust Walkthroughs
2024-02-14
~8 min read
github.com
...running `/usr/bin/package.rs` without root privileges)
How do we handle the `package.edition` field, balancing
single-file package use case needs (no boilerplate, modern
experience) with the expectations of Rust for reproducibility?
- Matching the expectation of a reproducible Rust experience
- Users wanting the latest experience, in general
- Boilerplate...
RFC 3424
RFC
2023-04-26
~16 min read
doc.rust-lang.org
...match page_title(url).poll() {
Ready(page_title) => match page_title {
Some(title) => println!("The title for {url} was {title}"),
None => println!("{url} had no title"),
}
Pending => {
// But what goes here?
}
}
What should we do when the future is still Pending? We need some way to try again, and again...
The Rust Programming Language
Book
2024-02-01
~17 min read