Skip to content

Commit 6d5c591

Browse files
committed
Replace i32 by char in split_at & _unchecked
1 parent 891a75b commit 6d5c591

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

library/core/src/slice/mod.rs

+12-12
Original file line numberDiff line numberDiff line change
@@ -1883,23 +1883,23 @@ impl<T> [T] {
18831883
/// # Examples
18841884
///
18851885
/// ```
1886-
/// let v = [1, 2, 3, 4, 5, 6];
1886+
/// let v = ['a', 'b', 'c'];
18871887
///
18881888
/// {
18891889
/// let (left, right) = v.split_at(0);
18901890
/// assert_eq!(left, []);
1891-
/// assert_eq!(right, [1, 2, 3, 4, 5, 6]);
1891+
/// assert_eq!(right, ['a', 'b', 'c']);
18921892
/// }
18931893
///
18941894
/// {
18951895
/// let (left, right) = v.split_at(2);
1896-
/// assert_eq!(left, [1, 2]);
1897-
/// assert_eq!(right, [3, 4, 5, 6]);
1896+
/// assert_eq!(left, ['a', 'b']);
1897+
/// assert_eq!(right, ['c']);
18981898
/// }
18991899
///
19001900
/// {
1901-
/// let (left, right) = v.split_at(6);
1902-
/// assert_eq!(left, [1, 2, 3, 4, 5, 6]);
1901+
/// let (left, right) = v.split_at(3);
1902+
/// assert_eq!(left, ['a', 'b', 'c']);
19031903
/// assert_eq!(right, []);
19041904
/// }
19051905
/// ```
@@ -1969,23 +1969,23 @@ impl<T> [T] {
19691969
/// # Examples
19701970
///
19711971
/// ```
1972-
/// let v = [1, 2, 3, 4, 5, 6];
1972+
/// let v = ['a', 'b', 'c'];
19731973
///
19741974
/// unsafe {
19751975
/// let (left, right) = v.split_at_unchecked(0);
19761976
/// assert_eq!(left, []);
1977-
/// assert_eq!(right, [1, 2, 3, 4, 5, 6]);
1977+
/// assert_eq!(right, ['a', 'b', 'c']);
19781978
/// }
19791979
///
19801980
/// unsafe {
19811981
/// let (left, right) = v.split_at_unchecked(2);
1982-
/// assert_eq!(left, [1, 2]);
1983-
/// assert_eq!(right, [3, 4, 5, 6]);
1982+
/// assert_eq!(left, ['a', 'b']);
1983+
/// assert_eq!(right, ['c']);
19841984
/// }
19851985
///
19861986
/// unsafe {
1987-
/// let (left, right) = v.split_at_unchecked(6);
1988-
/// assert_eq!(left, [1, 2, 3, 4, 5, 6]);
1987+
/// let (left, right) = v.split_at_unchecked(3);
1988+
/// assert_eq!(left, ['a', 'b', 'c']);
19891989
/// assert_eq!(right, []);
19901990
/// }
19911991
/// ```

0 commit comments

Comments
 (0)