-
Notifications
You must be signed in to change notification settings - Fork 104
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
Add SplitByteSlice::split_at_unchecked
#1071
Conversation
748ec27
to
4bac39f
Compare
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 worry that this commits us to an API - try_split_at
- that we're not 100% sure we want long-term. The only use of it in this PR is internal to the crate, so maybe we could just make it a private bare function? We'd keep the introduction of split_at_unchecked
, and we'd keep split_at
as a method with a default impl. Those changes need to go in now (before 0.8) since they're breaking changes. But making try_split_at
a private function accomplishes the same goals as this PR but commits us to fewer APIs long-term.
SplitByteSlice::{try_split_at, split_at_unchecked}
SplitByteSlice::split_at_unchecked
Done. |
ade377a
to
b2e4740
Compare
src/lib.rs
Outdated
// `l_ptr` is non-null, because `self` is non-null, by invariant on | ||
// `&mut [u8]`. | ||
let l_ptr = self.as_mut_ptr(); | ||
|
||
// `l_ptr` is non-null, because `self` is non-null, by invariant on | ||
// `&mut [u8]`. |
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.
Maybe only say this (in comments) once?
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.
Done.
Given the importance of avoiding panic paths to some of our customers, we should, as a rule, avoid only offering (or relying upon) APIs with panic paths. Related to #202
The Kani breakage is tracked upstream: model-checking/kani#3138 |
Given the importance of avoiding panic paths to some of our customers, we should, as a rule, avoid only offering (or relying upon) APIs with panic paths.
Related to #202