diff options
Diffstat (limited to 'library/core')
| -rw-r--r-- | library/core/src/marker/variance.rs | 2 | ||||
| -rw-r--r-- | library/core/src/str/mod.rs | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/library/core/src/marker/variance.rs b/library/core/src/marker/variance.rs index f9638fea225..55fdacb014e 100644 --- a/library/core/src/marker/variance.rs +++ b/library/core/src/marker/variance.rs @@ -18,7 +18,7 @@ macro_rules! phantom_type { pub struct $name:ident <$t:ident> ($($inner:tt)*); )*) => {$( $(#[$attr])* - pub struct $name<$t>($($inner)*) where T: ?Sized; + pub struct $name<$t>($($inner)*) where $t: ?Sized; impl<T> $name<T> where T: ?Sized diff --git a/library/core/src/str/mod.rs b/library/core/src/str/mod.rs index 5051b2288fd..d250e1478d8 100644 --- a/library/core/src/str/mod.rs +++ b/library/core/src/str/mod.rs @@ -1495,6 +1495,9 @@ impl str { /// The [pattern] can be a `&str`, [`char`], a slice of [`char`]s, or a /// function or closure that determines if a character matches. /// + /// If there are no matches the full string slice is returned as the only + /// item in the iterator. + /// /// [`char`]: prim@char /// [pattern]: self::pattern /// @@ -1526,6 +1529,9 @@ impl str { /// let v: Vec<&str> = "lion::tiger::leopard".split("::").collect(); /// assert_eq!(v, ["lion", "tiger", "leopard"]); /// + /// let v: Vec<&str> = "AABBCC".split("DD").collect(); + /// assert_eq!(v, ["AABBCC"]); + /// /// let v: Vec<&str> = "abc1def2ghi".split(char::is_numeric).collect(); /// assert_eq!(v, ["abc", "def", "ghi"]); /// |
