Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make schema_versions::KNOWN_VERSIONS const #7677

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

iliana
Copy link
Contributor

@iliana iliana commented Feb 27, 2025

Every time I add a database migration I stare at this and think "that could be const". I think I've finally figured out a non-obtrusive way to do it.

There's a handful of other unnecessary uses of LazyLock in Omicron that I want to go clean up but this one probably is worth having its own review.

@iliana
Copy link
Contributor Author

iliana commented Feb 27, 2025

(If you didn't know, you can more easily review PRs like this with heavy whitespace changes by adding ?w=1: https://github.com/oxidecomputer/omicron/pull/7677/files?w=1)

@iliana
Copy link
Contributor Author

iliana commented Feb 28, 2025

Looking it up, I think this probably ought to be a static even if we can remove the LazyLock so it is only present in the binary once. Actually wait, because it’s a slice the “const” should be the memory reference and therefore small…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant