Pinned ·

Rust: Render `serde` Errors For Humans Using `format_serde_error`

Foreword The serde crate is certainly one of the finest tools in the box. I rarely work on a project that does not make use of it; most of the time it is a user-facing usage - prominently: configuration files. Now, humans make mistakes, and I think software should be blameless an…

Pinned ·

Rust: How to Unwrap Multiple Required Options

Let's say we have a function that returns an Option. fn get_option() -> Option<bool> { Some(true) } We call it in main for this example and print the value using the dbg! macro: fn main() { let b = get_option(); dbg!(b); } This will yield: [src/…

Pinned ·

How to Update NixOS

I recently wrote a post called How to Setup NixOS on a Raspberry Pi and haven't touched the system I setup there in a little while. Now I booted it back up and found that there has been a new release of NixOS in the meantime. So here is a quick how-to on updating NixOS: Login a…