-
Notifications
You must be signed in to change notification settings - Fork 32
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 buffer -> dtype dependency #309
Conversation
}), | ||
// Cannot always convert bytes into a mutable vec | ||
Buffer::Arrow(buffer) => buffer.into_vec::<u8>().map_err(Buffer::Arrow), | ||
// Cannot convert bytes into a mutable vec | ||
Buffer::Bytes(_) => Err(self), |
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.
why is this an Err? If you are the only one holding the bytes then this should be possible
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.
I don't think you can go from Bytes back to BytesMut
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.
https://rustasync.github.io/runtime/bytes/struct.Bytes.html#method.try_mut seems to be the right signature and then you can use that to construct vec from parts?
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.
🤦 I missed that. I thought it seemed odd
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.
Hmmm no, I'm not sure what docs those are but they're not up-to-date for the bytes crate. See also tokio-rs/bytes#350
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.
Looks like someone is hosting their own fork or some outdated link that google served. You’re right. Maybe we need our own version as well?
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.
We do anyway to have more control over alignment. This crate tries to abstract that away for now.
Part of my refactor to turn vortex-buffer into our equivalent of the "bytes" crate
TODO: remove match_integers_by_width which previously was used for unchecked transmute