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
..
2021-06-03 16:13:45 +02:00
2021-10-18 19:19:28 +09:00
2021-12-15 00:11:23 +08:00
2021-10-18 19:19:28 +09:00
2021-03-03 11:23:29 +01:00
2021-12-16 22:11:17 -08:00
2021-12-10 05:07:52 -08:00
2021-10-18 19:19:28 +09:00
2021-12-17 20:46:47 +08:00
2021-11-28 01:31:25 -05:00
2021-12-17 20:46:47 +08:00
2021-12-12 14:02:53 +09:00
2021-10-17 18:39:54 +09:00
2021-12-02 19:22:00 -08:00