-
Notifications
You must be signed in to change notification settings - Fork 13.5k
cleanup: s/v.slice*()
/&v[a..b]
/g + remove redundant as_slice()
calls
#21680
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
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
@bors: r+ 02dd786 <3 this cleanup |
@@ -155,7 +155,7 @@ impl<'a> Iterator for MutDnaSeqs<'a> { | |||
fn next(&mut self) -> Option<&'a mut [u8]> { | |||
let tmp = std::mem::replace(&mut self.s, &mut []); | |||
let tmp = match memchr(tmp, b'\n') { | |||
Some(i) => tmp.slice_from_mut(i + 1), | |||
Some(i) => &mut tmp[i + 1..], |
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.
Is this equivalent to (i+1)..
? Seems a bit surprising given how ..
looks like it's attached to 1
.
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.
yes, and yes. I think some people tend to write i+1..
(no spaces), to improve readability, but I think we don't have a convention for this (yet).
Replaces `slice_*` method calls with slicing syntax, and removes `as_slice()` calls that are redundant due to `Deref`.
💔 Test failed - auto-win-32-nopt-t |
@bors: retry |
⌛ Testing commit bce81e2 with merge 7152b50... |
💔 Test failed - auto-linux-32-nopt-t |
@bors: retry |
Replaces `slice_*` method calls with slicing syntax, and removes `as_slice()` calls that are redundant due to `Deref`.
Replaces
slice_*
method calls with slicing syntax, and removesas_slice()
calls that are redundant due toDeref
.