| Age | Commit message (Collapse) | Author | Lines |
|
Fix mismatching Kleene operators
|
|
|
|
wip nth_back for chunks_mut
working chunksmut
fixed nth_back for chunksmut
Signed-off-by: wizAmit <amitforfriends_dns@yahoo.com>
|
|
wip nth_back for chunks_exact
working nth_back for chunks exact
Signed-off-by: wizAmit <amitforfriends_dns@yahoo.com>
|
|
Implement nth_back for slice::{Iter, IterMut}
Part of #54054.
I implemented `nth_back` as straightforwardly as I could, and then slightly changed `nth` to match `nth_back`. I believe I did so correctly, but please double-check 🙂
I also added the helper methods `zst_shrink`, `next_unchecked`, and `next_back_unchecked` to get rid of some duplicated code. These changes hopefully make this code easier to understand for new contributors like me.
I noticed the `is_empty!` and `len!` macros which sole purpose seems to be inlining, according to the comment right above them, but the `is_empty` and `len` methods are already marked with `#[inline(always)]`. Does that mean we could replace these macros with method calls, without affecting anything? I'd love to get rid of them.
|
|
Add custom nth_back to Skip
Implementation of nth_back for Skip.
Part of #54054
|
|
Stabilize copy_within
Closes #54236.
|
|
implement nth_back for Range(Inclusive)
This is part of #54054.
|
|
|
|
|
|
|
|
Add Bound::cloned()
Suggested by #61356
|
|
Co-Authored-By: Jack O'Connor <oconnor663@gmail.com>
|
|
This ensures we won't accidentally read *src or *dest even when count = 0.
|
|
|
|
Stabilize reverse_bits feature
FCP done in https://github.com/rust-lang/rust/issues/48763#issuecomment-497349379
Closes #48763
r? @Centril
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Feature/nth back chunks
A succinct implementation for nth_back on chunks. Thank you @timvermeulen for the guidance.
r? @timvermeulen
|
|
Implement nth_back for RChunks(Exact)(Mut)
Part of #54054.
These implementations may not be optimal because of the use of `self.len()`, but it's quite cheap and simplifies the code a lot.
There's quite some duplication going on here, I wouldn't mind cleaning this up later. A good next step would probably be to add private `split_off_up_to`/`split_off_from` helper methods for slices since their behavior is commonly useful throughout the `Chunks` types.
r? @scottmcm
|
|
Implement `iter::Sum` and `iter::Product` for `Option`
This is similar to the existing implementation for `Result`. It will take each item into the accumulator unless a `None` is returned.
I based a lot of this on #38580. From that discussion it didn't seem like this addition would be too controversial or difficult. One thing I still don't understand is picking the values for the `stable` attribute. This is my first non-documentation PR for rust so I am open to any feedback on improvements.
|
|
|
|
|
|
|
|
Signed-off-by: wizAmit <amitforfriends_dns@yahoo.com>
|
|
Signed-off-by: wizAmit <amitforfriends_dns@yahoo.com>
|
|
Signed-off-by: wizAmit <amitforfriends_dns@yahoo.com>
|
|
|
|
|
|
Signed-off-by: wizAmit <amitforfriends_dns@yahoo.com>
|
|
Signed-off-by: wizAmit <amitforfriends_dns@yahoo.com>
|
|
coretest: Downgrade deny to warn
The `deny` causes a build failure in https://github.com/RalfJung/miri-test-libstd. Since we use `-D warnings` for rustc builds, `warn` should be enough to lead to compile errors here, without impeding external builds.
|
|
|
|
|
|
|
|
|
|
Implement saturating_abs() and saturating_neg() functions for signed integer types
Similar to wrapping_abs() / wrapping_neg() functions but saturating at the numeric bounds instead of wrapping around. Complements the existing set of functions with saturation mechanics.
cc #59983
|
|
|
|
|
|
|
|
|
|
implement specialized nth_back() for Bytes, Fuse and Enumerate
Hi,
After my first PR has been successfully merged, here is my second pull request :-)
Also this PR contains some specializations for the problem discussed in #54054.
|
|
|
|
|
|
|
|
|