-
Notifications
You must be signed in to change notification settings - Fork 182
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
Remove AsVarULE #1126
Remove AsVarULE #1126
Conversation
Notice: the branch changed across the force-push!
~ Your Friendly Jira-GitHub PR Checker Bot |
(Rebased over #1127) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice! I really like the new looks of VarZeroVec!
Request: please approve and merge #1121 before merging this one, since there may be merge conflicts, and it is probably easier to resolve them in that direction. Thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Post-commit LGTM
Fixes #1078
This gets rid of AsVarULE, getting everyone to work off of the unsized
VarULE
types directly.This makes ZeroVec and VarZeroVec a bit asymmetric, ZeroVec takes
AsULE
types and internally stores them asULE
, performing convenient conversions at the boundary. OTOH,VarZeroVec
now directly takesVarULE
types, which in the case ofstr
and[u8]
are quite convenient to work with already, but less so for types likeVarZeroVecULE
. This is kinda fine: because ULE types can be held on the stack,ZeroVec
actually can make an attempt to do basically free conversions at the boundary, OTOHVarZeroVec
must use owned values to do the same thing, and this can be a little expensive.The major changes here:
VarZeroVecFoo
types now takeT: VarULE
VarZeroVec::to_vec()
returns `BoxVarZeroVec
requiresBox<T>
implementDeserialize
ZeroMap
operates on references in more place.ZeroMap::replace()
/ZeroMap::remove()
andZeroMap::insert()
returnBox<T>
for the old value