Skip to content

Make array of commands static#249

Closed
daniel-levin wants to merge 1 commit intooxidecomputer:masterfrom
daniel-levin:noheap
Closed

Make array of commands static#249
daniel-levin wants to merge 1 commit intooxidecomputer:masterfrom
daniel-levin:noheap

Conversation

@daniel-levin
Copy link
Copy Markdown

A minor non-functional change - I noticed there were was a Vec of CommandInfos where a static array would do fine.

@daniel-levin daniel-levin requested review from citrus-it, iliana and iximeow and removed request for iliana April 21, 2026 13:34
Copy link
Copy Markdown
Collaborator

@jclulow jclulow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can name and desc just be a &static str in that case?

@daniel-levin
Copy link
Copy Markdown
Author

Indeed, they can and it'd make sense for them to be!

@daniel-levin
Copy link
Copy Markdown
Author

Force pushed an update with this change and the associated removals of allocations.

 struct CommandInfo {
-    name: String,
-    desc: String,
+    name: &'static str,
+    desc: &'static str

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.

2 participants