by toast0 · 2y ago · 0 comments
Aren't you supposed to make a crate? Which is copying with more steps, but might make your life easier (or harder).
Yes, I suppose that would be the canonical way to go. But it's just one function; four lines! I'm getting isEven() vibes!
If that crate becomes successful, it will basically greenlight a lot of functionality that was just there because it happened to be made by the same author. And all that extra functionality will only reduce the chances of the really useful function to get into the spotlight. Both are bad for the ecosystem.
If the GP has related useful little functions, yes, pack them together. Otherwise, I'd say a crate for a small little function isn't a problem at all.
My point is that I keep my own little collection of useful code. I don’t publish it as a package or crate. It’s what I suggested to the other poster.