Always nice when reading the documentation (that exists!) a little more carefully reveals a simpler way to do what you want than what you originally expected to need.

Dear electric bicycle manufacturers, I'm not a bike shop. I don't know why you think I'm a bike shop. I don't have the space to become a bike shop. Please stop asking if I want to sell your bikes.

I could have written the code in a way that didn't trigger the warning which the compiler probably would turn it into the same thing, but it wouldn't be much different in SLOC from my comment and I think overall clarity would have been worse. I don't want to disable the warning more broadly, however, as it does indicate something that is almost always a mistake.

Show thread

Added two comments. One suppresses a specific warning, the other explains exactly why that warning is wrong in this very particular case where the code does exactly what is expected.

The problem with evening coding sessions is that I end up hungry and awake well past bed time.

Show older
Typica Social

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!