Skip to content

Commit

Permalink
Replace i32 by char in split_at & _unchecked
Browse files Browse the repository at this point in the history
  • Loading branch information
tkr-sh committed Dec 14, 2024
1 parent 891a75b commit 6d5c591
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions library/core/src/slice/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1883,23 +1883,23 @@ impl<T> [T] {
/// # Examples
///
/// ```
/// let v = [1, 2, 3, 4, 5, 6];
/// let v = ['a', 'b', 'c'];
///
/// {
/// let (left, right) = v.split_at(0);
/// assert_eq!(left, []);
/// assert_eq!(right, [1, 2, 3, 4, 5, 6]);
/// assert_eq!(right, ['a', 'b', 'c']);
/// }
///
/// {
/// let (left, right) = v.split_at(2);
/// assert_eq!(left, [1, 2]);
/// assert_eq!(right, [3, 4, 5, 6]);
/// assert_eq!(left, ['a', 'b']);
/// assert_eq!(right, ['c']);
/// }
///
/// {
/// let (left, right) = v.split_at(6);
/// assert_eq!(left, [1, 2, 3, 4, 5, 6]);
/// let (left, right) = v.split_at(3);
/// assert_eq!(left, ['a', 'b', 'c']);
/// assert_eq!(right, []);
/// }
/// ```
Expand Down Expand Up @@ -1969,23 +1969,23 @@ impl<T> [T] {
/// # Examples
///
/// ```
/// let v = [1, 2, 3, 4, 5, 6];
/// let v = ['a', 'b', 'c'];
///
/// unsafe {
/// let (left, right) = v.split_at_unchecked(0);
/// assert_eq!(left, []);
/// assert_eq!(right, [1, 2, 3, 4, 5, 6]);
/// assert_eq!(right, ['a', 'b', 'c']);
/// }
///
/// unsafe {
/// let (left, right) = v.split_at_unchecked(2);
/// assert_eq!(left, [1, 2]);
/// assert_eq!(right, [3, 4, 5, 6]);
/// assert_eq!(left, ['a', 'b']);
/// assert_eq!(right, ['c']);
/// }
///
/// unsafe {
/// let (left, right) = v.split_at_unchecked(6);
/// assert_eq!(left, [1, 2, 3, 4, 5, 6]);
/// let (left, right) = v.split_at_unchecked(3);
/// assert_eq!(left, ['a', 'b', 'c']);
/// assert_eq!(right, []);
/// }
/// ```
Expand Down

0 comments on commit 6d5c591

Please sign in to comment.