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

Should accesskit use Box<str>? #444

Open
PoignardAzur opened this issue Aug 14, 2024 · 0 comments
Open

Should accesskit use Box<str>? #444

PoignardAzur opened this issue Aug 14, 2024 · 0 comments

Comments

@PoignardAzur
Copy link
Contributor

A lot of accesskit APIs end up using Box<str> as their string type, which is not very idiomatic for Rust.

As far as I can tell, the reason is to save space in the PropertyValue enum. But that enum also has a few variants that are as large or larger than a String, meaning storing a Box<str> doesn't actually save space:

  • NodeIdVec has a Vec.
  • The Rect variant holds 4 f64
  • CustomActionVec has a Vec.

Should these variants be boxed? As far as I can tell every other type is two pointers long at most.

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

No branches or pull requests

1 participant