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

Fix lifetime of MultiIndex/UniqueIndex to be able to accept &str #232

Closed
ethanfrey opened this issue Mar 4, 2021 · 3 comments
Closed

Fix lifetime of MultiIndex/UniqueIndex to be able to accept &str #232

ethanfrey opened this issue Mar 4, 2021 · 3 comments
Milestone

Comments

@ethanfrey
Copy link
Member

There is an index function that takes K: PrimaryKey => Vec<u8> more or less. And indexes wrap this allowing a number of functions.

Currently this only works for static lifetimes (eg. PkOwned, String). It should be possible to support slices (&str, &[u8]) which will not just avoid a copy, but make the usability much nicer, as many types auto-deref to one of those slices.

Investigate what is needed to make this work for UniqueIndex (the simpler case), and if you can get a Proof of Concept to compile, then we decide if it makes sense to continue on this path.

@ethanfrey
Copy link
Member Author

let's try to fix this if we can. if it is too painful, let's close it and accept the status quo.
but good to stabilize the index functions

@maurolacy
Copy link
Contributor

maurolacy commented Jul 16, 2021

Will take another stab at this.

@ethanfrey ethanfrey added this to the v0.9.0 milestone Aug 17, 2021
@ethanfrey
Copy link
Member Author

This seems like a huge amount of work for marginal return. Closing for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants