Serde Default Values: Why Functions Instead of Constants?
If you’ve worked with Serde deserialization in Rust, you’ve probably seen code like this: You might be wondering: Why use a function? Why not just a constant? Well I did anway! This tutorial explains the reasoning behind this pattern and when to use it. The Problem: Missing Fields When deserializing JSON into Rust structs, you […]