I discovered Ansible's with_items today. It's great for removing duplication, and some modules (such as yum) even run faster with it!
miniblog.
Related Posts
Normally "make bad states unrepresentable" is super helpful advice.
I keep trying to use itertools::EitherOrBoth in my APIs but I go back to (Option<T>, Option<T>) every time. I just end up with too much duplication in between the Left, Right and Both cases.
Writing a changelog programmatically: https://github.com/clog-tool/clog-cli (really nice idea, saves duplication of work if your messages are thorough)