rust/library/core/src/str
bors 9f3998b4aa Auto merge of #77858 - ijackson:split-inclusive, r=KodrAus
Stabilize split_inclusive

### Contents of this MR

This stabilises:

 * `slice::split_inclusive`
 * `slice::split_inclusive_mut`
 * `str::split_inclusive`

Closes #72360.

### A possible concern

The proliferation of `split_*` methods is not particularly pretty.  The existence of `split_inclusive` seems to invite the addition of `rsplit_inclusive`, `splitn_inclusive`, etc.  We could instead have a more general API, along these kinds of lines maybe:
```
   pub fn split_generic('a,P,H>(&'a self, pat: P, how: H) -> ...
       where P: Pattern
       where H: SplitHow;

   pub fn split_generic_mut('a,P,H>(&'a mut self, pat: P, how: H) -> ...
       where P: Pattern
       where H: SplitHow;

   trait SplitHow {
       fn reverse(&self) -> bool;
       fn inclusive -> bool;
       fn limit(&self) -> Option<usize>;
   }

   pub struct SplitFwd;
   ...
   pub struct SplitRevInclN(pub usize);
```
But maybe that is worse.

### Let us defer that? ###

This seems like a can of worms.  I think we can defer opening it now; if and when we have something more general, these two methods can become convenience aliases.  But I thought I would mention it so the lang API team can consider it and have an opinion.
2021-01-13 07:38:58 +00:00
..
converts.rs Bump bootstrap compiler version 2020-11-19 19:23:36 -05:00
error.rs Add #[inline] to the Utf8Error accessors. 2020-10-18 15:38:32 +02:00
iter.rs bump split_inclusive stabilization to 1.51.0 2021-01-13 13:50:39 +10:00
lossy.rs Move utf-8 validating helpers to new mod 2020-09-26 05:20:53 +00:00
mod.rs Auto merge of #77858 - ijackson:split-inclusive, r=KodrAus 2021-01-13 07:38:58 +00:00
pattern.rs Fixed some intra-docs links in library/core 2020-09-18 07:49:29 +08:00
traits.rs Add lexicographical comparison doc 2020-10-26 22:39:43 +08:00
validations.rs Remove semicolon from internal err macro 2020-11-18 23:10:35 -05:00