Rust has an elegant solution to testing private functions: you put the test in the file that defines the function. It generally works well.
I've even seen people argue that it makes mocking much less necessary! I've not felt the need to mock in Rust so far.
miniblog.
Related Posts
My default assumption is that external libraries are better than what I (or an LLM) would write in a v1.
The extra effort to publish a project generally signifies that the author has spent a good amount of time on the problem. I end up prompting LLMs to prefer external code.
I find it fascinating how some businesses have scheduled downtime for their websites (e.g. my electricity provider last weekend), but others don't.
I suspect it's primarily culture. You generally need to turn off electricity to do work, so your other tooling may reflect that.
It's odd how lazy evaluation is generally seen as a niche design choice, yet the vast majority of languages treat `foo() || bar()` as short-circuiting.