You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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. :)
The text was updated successfully, but these errors were encountered:
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
I would love to use
ArrayString
, but it doesn't implementOrd
which is a constraint for me (types in differential dataflow need to beOrd
so they can be sorted for deduplication/consolidation).It seems like it could be a pretty simple implementation, as
String
just derivesOrd
which means it gets theVec<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 likeArrayVec
could be similarly workable, for typesT: 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. :)
The text was updated successfully, but these errors were encountered: