rust/library/core/src
Matthias Krüger 60625a6ef0
Rollup merge of #88858 - spektom:to_lower_upper_rev, r=dtolnay
Allow reverse iteration of lowercase'd/uppercase'd chars

The PR implements `DoubleEndedIterator` trait for `ToLowercase` and `ToUppercase`.

This enables reverse iteration of lowercase/uppercase variants of character sequences.
One of use cases:  determining whether a char sequence is a suffix of another one.

Example:

```rust
fn endswith_ignore_case(s1: &str, s2: &str) -> bool {
    for eob in s1
        .chars()
        .flat_map(|c| c.to_lowercase())
        .rev()
        .zip_longest(s2.chars().flat_map(|c| c.to_lowercase()).rev())
    {
        match eob {
            EitherOrBoth::Both(c1, c2) => {
                if c1 != c2 {
                    return false;
                }
            }
            EitherOrBoth::Left(_) => return true,
            EitherOrBoth::Right(_) => return false,
        }
    }
    true
}
```
2021-12-23 00:28:51 +01:00
..
alloc Fix a bunch of typos 2021-12-14 16:40:43 +01:00
array Do array-slice equality via arrays, rather than always via slices 2021-12-14 13:15:15 -08:00
char Rollup merge of #88858 - spektom:to_lower_upper_rev, r=dtolnay 2021-12-23 00:28:51 +01:00
convert Revert "Auto merge of #89450 - usbalbin:const_try_revert, r=oli-obk" 2021-12-12 12:34:59 +08:00
fmt Use non-generic inner function for pointer formatting 2021-11-26 13:59:57 -05:00
future Rollup merge of #91721 - danielhenrymantilla:patch-1, r=joshtriplett 2021-12-11 17:35:27 +01:00
hash Apply suggestions from code review 2021-11-23 23:55:05 +01:00
iter Rollup merge of #91916 - steffahn:fix-typos, r=dtolnay 2021-12-15 10:57:02 +01:00
macros Implement concat_bytes! 2021-12-06 21:05:13 -05:00
mem Add space and 2 grave accents 2021-12-17 23:11:04 +01:00
num Rollup merge of #91141 - jhpratt:int_roundings, r=joshtriplett 2021-12-19 10:45:50 +01:00
ops Reduce verbosity for ? on non-Try expressions 2021-12-13 17:09:15 +00:00
panic Rollup merge of #89897 - jkugelman:must-use-core, r=joshtriplett 2021-10-31 09:20:26 +01:00
prelude Stabilize asm! and global_asm! 2021-12-12 11:20:03 +00:00
ptr Rollup merge of #91823 - woppopo:const_ptr_as_ref, r=lcnr 2021-12-21 08:33:40 +01:00
slice Fix SB problems in slice sorting 2021-12-16 10:31:46 -05:00
str Fix a bunch of typos 2021-12-14 16:40:43 +01:00
stream Remove P: Unpin bound on impl Stream for Pin 2021-12-17 11:14:02 +08:00
sync Make From impls of NonZero integer const. 2021-10-20 12:04:58 +09:00
task Rollup merge of #89897 - jkugelman:must-use-core, r=joshtriplett 2021-10-31 09:20:26 +01:00
unicode Regenerate tables for Unicode 14.0.0 2021-10-06 17:49:33 -07:00
any.rs fix doc links for downcast_unchecked 2021-11-20 18:22:05 -05:00
ascii.rs Add #[must_use] to remaining core functions 2021-10-30 18:21:29 -04:00
bool.rs Constify bool::then{,_some} 2021-12-15 00:11:23 +08:00
borrow.rs Make Borrow and BorrowMut impls const 2021-12-04 21:57:39 +09:00
cell.rs Fix a bunch of typos 2021-12-14 16:40:43 +01:00
clone.rs Update Copy/Clone documentation WRT arrays 2021-11-08 13:11:59 -05:00
cmp.rs Mark defaulted PartialEq/PartialOrd methods as const 2021-12-16 21:35:25 -08:00
default.rs Add #[must_use] to remaining core functions 2021-10-30 18:21:29 -04:00
ffi.rs Use target_family = "wasm" 2021-11-10 08:35:42 -08:00
hint.rs Add spin_loop hint for RISC-V architecture 2021-12-05 16:39:21 +08:00
internal_macros.rs Added docs to internal_macro const 2021-10-22 10:07:35 +13:00
intrinsics.rs link to pref_align_of tracking issue 2021-12-15 18:39:17 +01:00
lazy.rs Make more From impls const 2021-10-18 19:19:28 +09:00
lib.rs Constify (most) Option methods 2021-12-17 20:46:47 +08:00
marker.rs Update Copy/Clone documentation WRT arrays 2021-11-08 13:11:59 -05:00
option.rs Point to the tracking issue 2021-12-17 20:48:04 +08:00
panic.rs Allow panic!("{}", computed_str) in const fn. 2021-09-15 21:56:43 +01:00
panicking.rs Permit const assertions in stdlib 2021-11-08 17:06:00 -05:00
pin.rs Add #[must_use] to remaining core functions 2021-10-30 18:21:29 -04:00
primitive.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
primitive_docs.rs Update docs. 2021-12-04 19:40:33 +01:00
result.rs Auto merge of #91752 - yaahc:track-caller-result, r=cuviper 2021-12-15 06:34:00 +00:00
time.rs Apply cfg-bootstrap switch 2021-11-30 10:51:42 -05:00
tuple.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
unit.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00