Wed 05 Oct 2022

Rust's Result Type is Cool

If you've worked with Rust before, you know how different its error handling story is from most other languages. The Rust Programming Language explains the two primary ways of raising errors, panicking and the Result type, and how you can propagate the Result type with the ? operator to make recoverable errors explicit without interfering with the happy path in a certain function.

Source: Rust's Result Type is Cool, an article by Eshan Singh.

Just commit more!

Over new years this past year I made dura. It’s like auto-backup for Git. It tries to stay out of the way until you’re in a panic, trying to figure out how to rescue your repository from a thoughtless git reset --hard. It makes background commits, real Git commits that you don’t normally have to see in the log, by committing to a different branch than the one you have checked out. Overall, it’s been a blast. I’ve learned a lot from the contributors, like how to write well-formed Rust as well as a bit about Nix.

One recurring quesion has been, “why don’t you just commit more”?

It’s not a bad question. I clearly went through a lot of effort to build a tool in Rust. I could’ve changed my own behavior. I guess it bugged me how many hours were being wasted on rescuing repositories around the world when the answer is so easy: just commit more.

Source: Just commit more!, an article by Tim Kellogg.