phaazon.net
...We don’t
want to expose the internals of the type because we might add a lot of other things in there and
allowing people to pattern-match a Person would break their code when we add more things.
impl Person {
pub fn new(name: String) -> Person {
Person { name }
}
}
That...
News & Blog Posts
2018-11-06
~8 min read
blog.guillaume-gomez.fr
...result = subprocess.run(
["perf", "stat", binary_path],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True
)
stdout_lines = result.stdout.strip().splitlines()
binary_number = int(stdout_lines[0].split(':')[-1].strip())
match = re.search(r"([\d,]+)\s+instructions", result.stderr)
if not match:
continue
instructions_str = match.group(1).replace(",", "")
instructions...
Project/Tooling Updates
2026-11-04
~17 min read
blog.darklang.com
...HN user momentumtop's explanation match my feelings exactly:The Haskell community, in my experience, is far more academic. A recent post to the Haskell libraries mailing list began with:"It was pointed out to me in a private communication that the tuple function \x->(x,x) is actually a...
Miscellaneous
2020-11-04
~5 min read
kerkour.com
...While in Rust, a non-exhaustive match produces a compile-time error:
#[derive(Debug, Clone, Copy)]
enum Platform {
Linux,
MacOS,
Windows,
Unknown,
}
impl fmt::Display for Platform {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Platform::Linux => write!(f, "Linux"),
Platform::Macos => write!(f, "macOS"),
// Compile time...
Observations/Thoughts
2022-05-04
~5 min read
www.iroh.computer
...This gives you precise error types that consumers can match on and handle differently. It's the approach that many library authors (rightfully) prefer because it provides a stable, matchable API.
Both approaches have their merits, but there's an interesting third option that's rarely discussed: the standard library...
Observations/Thoughts
2025-08-27
~8 min read
cglab.ca
Archived: primary link replaced with an archive on 2026-09-12T11:05:26.176Z (UTC; replacement date, not snapshot date)
...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
vercel.com
...In the end, we were able to validate that our Rust hashing code was working and matched the Go behavior.Overall, this approach really paid off for us. We found a lot of bugs that otherwise we would have struggled to find. We were able to validate that our code...
Observations/Thoughts
2024-02-14
~8 min read
www.sea-ql.org
...DbErr = cake .into_active_model() .insert(db) .await .expect_err("inserting should fail due to duplicate primary key");match error { DbErr::Exec(RuntimeErr::SqlxError(error)) => match error { Error::Database(e) => { // We check the error code thrown by the database (MySQL in this case), // `23000` means `ER_DUP_KEY`: we have...
Project/Tooling Updates
2022-11-16
~5 min read
rust-lang.github.io
...usize) -> u8 {
x.drain_range(index).next().unwrap()
}
fn pop(x: &mut Vec<u8>) -> Option<u8> {
match x.len() {
0 => None,
n => x.drain_range(n-1).next()
}
}
fn drain(x: &mut Vec<u8>) -> DrainRange<u8> {
x.drain_range(0..)
}
fn clear(x: &mut Vec<u8>) {
x.drain_range(0...
RFC 574
RFC
2015-01-12
~2 min read
lpc.events
...It also provides other important benefits, such as improved error handling, stricter typing, sum types, pattern matching, privacy, closures, generics, etc.
This microconference intends to cover talks and discussions on both Rust for Linux as well as other non-kernel Rust topics.
Possible Rust for Linux topics:
Rust in the...
Virtual
2024-08-21
~1 min read
smartthings.pinpointhq.com
...SmartThings offers Medical, Dental, Vision, HSA options, FSAs, EAP, 401(k) +matching, and various wellness benefits.
Unlimited PTO
We believe that work/life balance is a necessity, so we want to be sure you get the rest and relaxation you deserve.
Flex-Normal
With offices in Minneapolis, MN and Mountain...
Rust Jobs
2021-09-15
~2 min read
codigolinea.com
...herencia rígida, nulidad descontrolada, y la ausencia de funciones como valores de primera clase en los lenguajes de la épocaRust, por su parte, es un lenguaje multiparadigma que incorpora elementos de programación orientada a objetos (traits, impls) y funcional (inmutabilidad por defecto, pattern matching exhaustivo, enums con datos,zero-cost...
Rust Walkthroughs
2026-01-07
~2 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
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
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
doc.rust-lang.org
...items
• macro_rules declarations and matcher metavariables
• Implementation associated items
•
Expressions:
• Closure parameters
• while let pattern bindings
• for pattern bindings
• if let pattern bindings
• match pattern bindings
• Loop labels
•
Generic parameters
•
Higher ranked trait bounds
•
let statement pattern bindings
•
The macro_use attribute can introduce macro names from another crate...
The Rust Reference
Book
2024-01-01
~2 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
rust-lang.github.io
...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
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