zupzup.org
...let config = match Config::init() {
Ok(v) => v,
Err(e) => panic!("Could not read config from environment: {}", e),
};
For logging we use the slog crate. I won’t go into any details on logging, but there are several ways to set it up. The way we will use in our...
News & Blog Posts
2019-04-09
~10 min read
postacnormalna.pl
...f64) {
// Flap if space is pressed
let input = Input::godot_singleton();
if Input::is_action_pressed(&input, "ui_flap") {
match self.state {
PlayerState::Flying => {
self.state = PlayerState::Flapping;
self.flap(owner);
}
PlayerState::Flapping => self.flap(owner),
PlayerState::Dead => {}
}
}
.
.
.
}
Kolejnym miejscem, w którym należy rozważyć aktualny stan kraboptaka, jest dalsza część...
Rust Walkthroughs
2021-02-03
~11 min read
hurryabit.github.io
...Arg| {
let mut stack = Vec::new();
let mut current = f(arg);
let mut res = Res::default();
loop {
match Pin::new(&mut current).resume(res) {
GeneratorState::Yielded(arg) => {
stack.push(current);
current = f(arg);
res = Res::default();
}
GeneratorState::Complete(real_res) => {
match stack.pop() {
None => return real_res,
Some(top) => {
current...
Observations/Thoughts
2021-11-24
~7 min read
rust-osdev.com
...unify flags if multiple segments are mapped to same frame with different flags
Fix invalid mapping to zero page caused by off-by-one bug
adapt data layout to match LLVM's
Release v0.11.7
Remove unused paging imports
Thanks to @vinc and @tsatke for their contributions!
Other Projects...
Newsletters
2024-03-13
~2 min read
nitschinger.at
...position,
}
}
#[inline]
fn convert_term(term: &str) -> Term {
if term.len() <= MAX_STACK_TERM_LEN {
Term::Stack(ArrayString::<[_; MAX_STACK_TERM_LEN]>::from(term).unwrap())
} else {
Term::Heap(term.to_string())
}
}
#[inline]
pub fn term(&self) -> &str {
match self.term {
Term::Heap(ref s) => s.as_ref(),
Term::Stack(ref...
Blog Posts
2016-11-01
~15 min read
rust-lang.github.io
...Getter names follow Rust convention (C-GETTER)
• [ ] Methods on collections that produce iterators follow iter, iter_mut, into_iter (C-ITER)
• [ ] Iterator type names match the methods that produce them (C-ITER-TY)
• [ ] Feature names are free of placeholder words (C-FEATURE)
• [ ] Names use a consistent word order (C-WORD...
Rust API Guidelines
Book
2024-01-01
~3 min read
aidancully.blogspot.com
...F) -> Option<U> {
match self {
Some(x) => Some(f(x)),
None => None,
}
}
}
The lint detects that self is consumed, but the !ScopeDrop field won’t have drop glue generated in this function, so the function is linear-safe. The warning can be addressed by relaxing the T type to be...
Rust Walkthroughs
2021-12-15
~7 min read
dmitrii.app
...Its whole shape:resume(requestState) ──▶ match Resumed { … } ──▶ parse answers
│
┌─────────────────────────┴──────────┐
Err(should_reask) Ok(answers)
│ │
re-seal the same phase transition, seal the next
match resumed {
Resumed::AwaitingTrip(session) => match TripAnswers::parse(responses) {
Ok(answers) => self.ask(&session.respond(answers), forms::PARTY, &binding, proof),
Err(error) => self.reask(&session, forms::TRIP...
Observations/Thoughts
2026-08-12
~46 min read
www.lpalmieri.com
...Expected range of matching incoming requests: == 1
Number of matched incoming requests: 2
[...]'
The retry succeeded, but it resulted in the newsletter being delivered twice to our subscriber - the problematic behaviour we identified during the failure analysis at the very beginning of this chapter.
6. Implementation Strategies
How do we...
Rust Walkthroughs
2022-03-16
~65 min read
gill.net.in
...The firmware calculates a hash of the entire file and verifies it matches the expected hashEd25519 signature: A cryptographic signature ensures the firmware is authenticSequential chunk verification: The firmware validates that chunks arrive in order with correct offsetsThe Ed25519 public key is embedded in the firmware (
src/ota.rs
). In...
Rust Walkthroughs
2025-12-17
~10 min read
slowtec.de
...Because we won't use WebPack and its plugins anymore we have to
replace all templating parts that match the pattern <%= ... %>:
- <title><%= htmlWebpackPlugin.options.title %></title>
+ <title>Porting JS to Rust</title>
Additionally ensure that the document's charset is set to utf-8:
<meta charset="utf-8" />
Now we...
News & Blog Posts
2019-12-24
~7 min read
rust-trends.com
...The hybrid search combines vector similarity with BM25 keyword matching.The project positions itself as a lightweight alternative to OpenClaw, the popular open-source AI assistant. That means roughly 15,000 lines of Rust versus OpenClaw's 460,000 lines of TypeScript, with about 45 crates versus a far larger...
Newsletters
2026-02-11
~6 min read
kobzol.github.io
...fn clone_request(&mut self, req: &Request<OctoBody>)
-> Option<Request<OctoBody>> {
match self {
RetryConfig::None => None,
_ => {
// `Request` can't be cloned
let mut new_req = Request::builder()
.uri(req.uri())
.method(req.method())
.version(req.version());
for (name, value) in req.headers() {
new_req = new_req.header(name, value);
}
let...
Miscellaneous
2025-12-31
~19 min read
blog.adamchalmers.com
...let mut stream = signal(signal_kind)?;
loop {
stream.recv().await;
match std::fs::read_to_string("cert.pem") {
Ok(_) => eprintln!("Successfully reloaded cert"),
Err(e) => eprintln!("could not reload cert: {e}"),
}
}
}
This works, but it's not a very good user experience for whoever's sending the signal. Say you...
Observations/Thoughts
2023-11-22
~6 min read
predr.ag
...Breakage of patterns is not always semver-major
Pattern-matching on structs is always allowed in Rust, even if the struct being matched has no visible fields: playground link.
// say this is in some other crate
pub mod other {
pub struct Foo(i64);
}
fn process(value: &other::Foo) {
// Foo's...
Observations/Thoughts
2023-02-01
~7 min read
without.boats
...Future> MaybeDone<F> {
fn maybe_poll(&pin mut self, cx: &mut Context<'_>) {
if let MaybeDone::Polling(fut) = self {
if let Poll::Ready(res) = fut.poll(cx) {
*self = MaybeDone::Done(UnpinCell::new(Some(res)));
}
}
}
fn is_done(&self) -> bool {
matches!(self, &MaybeDone::Done(_))
}
fn take_output(&pin mut self) -> Option<F...
Observations/Thoughts
2024-10-23
~2 min read
faultlore.com
...The subtle implications, they are here! We don’t need to generate proper match statements for untagged unions, because the test harness generating the code already knows which case every single value is. So for tagged unions, instead of actually generating a full match it could generate this:
// I am...
Observations/Thoughts
2024-05-08
~24 min read
rust-osdev.com
...Linux 6.15 kernel arrives - and it's big a victory for Rust fans
Rust Coreutils 0.1 Released With Big Performance Gains - Can Match Or Exceed GNU Speed
Edit is now open source
ChromeOS Virtual Machine Monitor is written in Rust with over 300k LoC
First look at Blinksy...
Newsletters
2025-06-18
~2 min read
matklad.github.io
...loop {
match self.0.compare_and_swap(
Self::UNINIT,
Self::ACTIVE,
Relaxed,
) {
Self::UNINIT => {
let val = init();
self.0.store(
match val {
Self::UNINIT | Self::ACTIVE => Self::UNINIT,
val => val,
},
Relaxed,
);
return val;
}
Self::ACTIVE => wait(),
val => return val,
}
}
}
}
There’s a static instance of LazyUsize
which caches file descriptor...
News & Blog Posts
2019-12-31
~11 min read
saybackend.com
...pub fn missing_where_operations(&self) -> Vec<Operation> {
let mut missing = Vec::new();
for stmt in &self.statements {
match stmt {
// Check UPDATE
Statement::Update { selection, .. } if selection.is_none() => {
missing.push(Operation::Update);
}
// Check DELETE
Statement::Delete { selection, .. } if selection.is_none() => {
missing.push(Operation::Delete);
}
_ => {}
}
}
missing
}
}NoSQL QueryPostgres Parses...
Rust Walkthroughs
2026-02-18
~10 min read