up_set
A #![no_std], no dependencies crate which allows you to write functions that either set the value or update it using a closure.
use UpSet;
// `M` is a generic marker to guide Rust's type inference
// system to choose the correct implementation of `UpSet`
// for either `u32` or `Fn(u32) -> u32`
assert_eq!;
assert_eq!;
The benefit of this approach over using a pub field is that you can chain many updates together:
Rectangle
.x
.y
.width
.height