Mastodon Feed: Post

Mastodon Feed

NfNitLoop ("Cody Casterline 🏳️‍🌈") wrote:

@vi_mi You got it! `const` -> `static` was the fix.

I guess `const` just causes the variable to be inlined at every call site. Where `static` creates a single instance that can be referenced.

I'd missed learning/internalizing that nuance since, when I reach for const, it's usually for things that are `Copy` anyway, like a `u64` or `&str`.