Open allaboutevemirolive opened 3 months ago
I'm not convinced about this implementation. All fields will be called regardless of whether they're used, so wrapping the type in Option
seems unnecessary.
The key difference is that using Option
requires us to check or unwrap it for every folder iteration. Without Option
, we can avoid these extra steps, either calling a function that performs an action or a no-op function.
For context: https://doc.rust-lang.org/beta/std/primitive.fn.html
https://github.com/allaboutevemirolive/trees-rs/blob/a5a90585bfd48f26552ddd1e81f1cc6876c9bb05/src/config/registry.rs#L30-L56