Skip to content

make schema_versions::KNOWN_VERSIONS const#7677

Open
iliana wants to merge 1 commit intomainfrom
iliana/const-schema
Open

make schema_versions::KNOWN_VERSIONS const#7677
iliana wants to merge 1 commit intomainfrom
iliana/const-schema

Conversation

@iliana
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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