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

Could ArrayVec and ArrayString implement Ord? #50

Closed
frankmcsherry opened this issue Apr 22, 2017 · 0 comments
Closed

Could ArrayVec and ArrayString implement Ord? #50

frankmcsherry opened this issue Apr 22, 2017 · 0 comments

Comments

@frankmcsherry
Copy link

frankmcsherry commented Apr 22, 2017

I would love to use ArrayString, but it doesn't implement Ord which is a constraint for me (types in differential dataflow need to be Ord so they can be sorted for deduplication/consolidation).

It seems like it could be a pretty simple implementation, as String just derives Ord which means it gets the Vec<u8> implementation. I guess it would be similar here, except needing to manually slice the backing contents in the impl to avoid touching invalid data. It seems like ArrayVec could be similarly workable, for types T: Ord.

Edit: I'd be happy to do a PR, but I'm not sure I grok all of the index cleverness, and wouldn't want to mess things up. If you'd rather I take a stab first, let me know. :)

@frankmcsherry frankmcsherry changed the title Could ArrayVec and ArrayString derive Ord? Could ArrayVec and ArrayString implement Ord? Apr 22, 2017
tbu- added a commit to tbu-/arrayvec that referenced this issue Apr 22, 2017
@bluss bluss closed this as completed in #51 Apr 22, 2017
tbu- added a commit to tbu-/arrayvec that referenced this issue Apr 22, 2017
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