cglab.ca
...Traverse<RingBufIter>>
Iterator<A> for AbsItems<DListIter, RingBufIter> {
fn next(&mut self) -> Option<A> {
if self.len > 0 { self.len -= 1; }
loop {
let (ret, iter) = match self.left_block_iter.as_mut() {
None => match self.list_iter.next() {
None => match self.right_block_iter.as_mut() {
None => return None,
Some...
Blog Posts
2014-12-01
~18 min read
buildnectar.com
...When a signal changes, only the exact DOM node updates.
🔒
Compile-Time Safety
Rust-inspired borrow checker, type system, and exhaustive pattern matching. Catch bugs before they ship — not in production.
📦
Zero Dependencies
No npm, no node_modules, no webpack, no bundler. Your app compiles to a .wasm binary and...
Project/Tooling Updates
2026-07-08
~2 min read
blog.meilisearch.com
...name CONTAINS kef — search will match the document
name CONTAINS clifford — search will not match the document
Remember all filters used lowercase, normalized strings (all accents are removed).
Experimental: update documents with a function
Meilisearch 1.10 allows you to edit documents by executing a Rhai function. This allows you...
Project/Tooling Updates
2024-08-28
~5 min read
git-cliff.org
...For example, you can use filter(attribute="merge_commit", value=false) as follows:
{% for group, commits in commits | filter(attribute="merge_commit", value=false) | group_by(attribute="group") %} ### {{ group | upper_first }} {% for commit in commits %} - {{ commit.message | upper_first }}\ {% endfor %}{% endfor %}\n
🔍 Match by commit SHA
It is now possible...
Project/Tooling Updates
2024-02-21
~5 min read
redox-os.org
...Details here.
@mmstick Implemented conditional support with match cases. Details here.
@mmstick Refactored some work. Details here.
@bb010g Set rust-toolchain for latest nightly. Details here.
@nivkner Refactored match statements. Details here.
@nivkner Made a change to distinguish between environment and local variables. Details here.
@nivkner Re-enabled ignoring commands...
News & Blog Posts
2017-09-26
~12 min read
code.camdenreslink.com
...ObjectID) -> Result<ClassID, HRESULT>;
Calling code can use a match expression to extract the ClassID:
let class_id = profiler_info.get_class_from_object(object_id);
match class_id {
Ok(class_id) => class_id,
Err(hr) => hr,
}
Or use the ? operator to return the error from the function enclosing the...
Miscellaneous
2020-08-11
~11 min read
codeconstruct.com.au
...DataEncoding) -> Result<Self, Self::Error> {
match value {
DataEncoding::None => Err(()),
DataEncoding::Lsb => Ok(Self::Little),
DataEncoding::Msb => Ok(Self::Big),
}
}
}
}
#[derive(Debug, DekuRead, DekuWrite)]
#[deku(ctx = "endian: Endian", endian = "endian", id_type = "u16")]
#[repr(u16)]
enum Machine {
None = 0,
S390 = 22,
Arm = 40,
X86_64 = 62,
}
#[derive(Debug, DekuRead, DekuWrite...
Rust Walkthroughs
2025-11-26
~14 min read
rust.code-maven.com
...u8 = 254;
println!("count: {}", count);
for _ in 1..=3 {
match count.checked_add(1) {
Some(val) => count = val,
None => eprintln!("Too much!"),
};
println!("count: {}", count);
}
Same result in release mode.
It does not change the value and it returns an Option.
In the Some part we get the incremented number...
Miscellaneous
2024-01-10
~5 min read
docs.rs
...In this way it is intended
to supercede the existing SliceConcatExt::join method, which only works
on slices and can only join with a matching type.
§Examples
Create a comma separated list:
use joinery::Joinable;
let result = vec![1, 2, 3, 4].join_with(", ").to_string();
assert_eq!(result, "1...
Crate of the Week
2019-12-03
~1 min read
www.worthe-it.co.za
...sender_b.send("Hello world from Thread B");
thread::sleep(Duration::from_millis(500));
}
});
for _ in 0..10 {
// this will wait for a result from either thread
let message = receiver.recv();
match message {
Ok(msg) => {
println!("{}", msg);
},
Err(_) => {}
}
}
// Those two threads are in an infinite loop. Don't call .join...
News & Blog Posts
2017-07-04
~17 min read
github.com
...Though it is expected that the intrinsics provide
information to the optimizer, that information is not guaranteed to change the decisions the
optimiser makes.
## Drawbacks
The intrinsics cannot be used to hint at arms in `match` expressions. However, given that hints
would need to be variants, a simple intrinsic would...
RFC 1131
RFC
2015-05-20
~2 min read
sixtyfps.io
...handling :-)
Fixes #467
Fixes
Fix stretch of children of the GroupBox widget (
ec7d9a
)
Apply a vertical stretch in the fluent and ugly style, to match the native style.
Fixes #487
Interpreter: fix comparison of enums (
4aeb9b
)
We need to normalize native enum to use dashes
Make it possible to disable...
Project/Tooling Updates
2021-09-15
~2 min read
github.com
...impl Bar for &str { fn bound(&self) -> &int { ... } } // elided
impl<'a> Bar<'a> for &'a str { fn bound<'b>(&'b self) -> &'b int { ... } } // expanded
// Note that the preceding example's expanded methods do not match the
// signatures from the above trait definition for `Bar`; in the general
// case, if the...
RFC 141
RFC
2014-06-24
~9 min read
github.com
...High-level summary:
- several unnecessary uses of `repr(packed)` (patches have been
submitted and merged to remove all of these)
- most necessary ones are to match the declaration of a struct in C
- many "necessary" uses can be replaced by byte arrays/arrays of smaller types
- 8 crates are currently...
RFC 1240
RFC
2015-08-06
~10 min read
kerkour.com
...Where it becomes vicious is that it's totally possible to make Git tags and crates.io versions match while the code is different! There are absolutely no guarantees that the code on crates.io matches the code on GitHub, even if the tags and version numbers match!
How to...
Observations/Thoughts
2021-11-17
~8 min read
www.fpcomplete.com
...fn main() {
match std::fs::read_to_string("input.txt") {
Ok(s) => println!("{}", s),
Err(e) => eprintln!("Unable to read from input.txt: {:?}", e),
}
}
The presence of enums in Rust makes it really easy to ensure you properly handle all failure cases fully. The code above will not panic. If...
Observations/Thoughts
2020-12-02
~8 min read
tokio.rs
...Future<Output = Result<HttpResponse, Error>>,
{
let listener = TcpListener::bind(self.addr).await?;
loop {
let mut connection = listener.accept().await?;
let request = read_http_request(&mut connection).await?;
task::spawn(async move {
// Pattern match on the result of the response future
match handler(request).await {
Ok(response) => write_http_response(connection...
Rust Walkthroughs
2021-05-19
~22 min read
gfx-rs.github.io
...This also matches the goal of the Vulkan Portability Initiative to define a subset of Vulkan which can be efficiently implemented on top of D3D12 and Metal. We started experimenting with a C wrapper that implements “vulkan.h” on a target system. However, getting from a hacked prototype to a...
News & Blog Posts
2018-04-10
~2 min read
github.com
...The crate file I downloaded matches the `cksum` in the index; the index matches the `cksum` in the audit log; the public key used in the audit log is the one I expected.
This scheme could be augmented to allow the use of several signing technologies. We would need to...
RFC 3231
RFC
2022-02-02
~25 min read
hegdenu.net
...We match on *self.
(remember, Hello is an enum)
If we're in the initial state Init then print out hello, {name}!.
This is the body of our async function.
If we're in the Done state, we panic.
(more on this shortly)
After our match statement, we set our...
Rust Walkthroughs
2023-05-31
~8 min read