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

simplify conversion traits and wrapper types #11

Open
10 tasks
arcnmx opened this issue Apr 24, 2022 · 0 comments
Open
10 tasks

simplify conversion traits and wrapper types #11

arcnmx opened this issue Apr 24, 2022 · 0 comments

Comments

@arcnmx
Copy link
Owner

arcnmx commented Apr 24, 2022

Compile times seem to kind of blow up with too many generic impls, and it's not always worth the convenience.

  • consider a Wrapper<Type> type to replace any TypeWrapper structs
    • double-check that all Wrapper structs always name their single field data
  • impl explicit conversions to TypeWrapper rather than using complicated blanket impls.
    • IntWrapper: i32 i16 i8 u16 u8
    • StringWrapper: String Box<str> Cow<str> &str char
    • Type assuming a generic wrapper struct
  • forget about obscure impls for structs with a base plus optional fields
  • the tuple to enum conversions are likewise just as silly
  • reconsider how to handle types that have a base and nothing else
    • as well as a base and all optional fields

Not all of this necessarily relates to performance, but in general the idea is to be a bit more conservative for the sake of simplicity.

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