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 IntoArrayVariant chain more explicit #507

Open
a10y opened this issue Jul 24, 2024 · 2 comments
Open

Make IntoArrayVariant chain more explicit #507

a10y opened this issue Jul 24, 2024 · 2 comments

Comments

@a10y
Copy link
Contributor

a10y commented Jul 24, 2024

Currently we implement IntoArrayVariant for all T: IntoCanonical by first calling into_canonical and then downcasting. This hides that there is a potentially expensive decoding step going on.

We should either remove the shortcut method, or rename the methods to make it clearer that they can be expensive

@robert3005
Copy link
Member

Strong preference for single methods to avoid long chains. Need a good name though and likely will deviate from rust conventions

@a10y
Copy link
Contributor Author

a10y commented Jul 24, 2024

some options:

  • canonicalize_to_primitive
  • into_canonical_primitive
  • to_canonical_primitive
  • to_primitive

Another option is to replace methods with top-level function calls, e.g. canonical::to_primitive(array)

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

2 participants