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
Currently, raw::Slice is implemented implemented as len, data, and Vec is implemented as len, cap, data. This means that the following code requires a branch, which is extremely unfortunate for my use-case:
I think you made a minor typo, as slices are currently (ptr, len). I'll r+ a pull request switching Vec<T> to (ptr, len, cap) instead of (len, cap, ptr).
cgaebel
pushed a commit
to cgaebel/rust
that referenced
this issue
Oct 25, 2014
Currently,
raw::Slice
is implemented implemented aslen, data
, andVec
is implemented aslen, cap, data
. This means that the following code requires a branch, which is extremely unfortunate for my use-case:Ideally, the order of
Vec
's fields should be changed tolen, data, cap
to make conversion free.Thoughts?
The text was updated successfully, but these errors were encountered: