Skip to content

Commit 43f555b

Browse files
wr7gitbot
authored andcommitted
Rename elem_offset to element_offset
1 parent 8264d39 commit 43f555b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

core/src/slice/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4571,7 +4571,7 @@ impl<T> [T] {
45714571
/// let num = &nums[2];
45724572
///
45734573
/// assert_eq!(num, &1);
4574-
/// assert_eq!(nums.elem_offset(num), Some(2));
4574+
/// assert_eq!(nums.element_offset(num), Some(2));
45754575
/// ```
45764576
/// Returning `None` with an in-between element:
45774577
/// ```
@@ -4586,12 +4586,12 @@ impl<T> [T] {
45864586
/// assert_eq!(ok_elm, &[0, 1]);
45874587
/// assert_eq!(weird_elm, &[1, 2]);
45884588
///
4589-
/// assert_eq!(arr.elem_offset(ok_elm), Some(0)); // Points to element 0
4590-
/// assert_eq!(arr.elem_offset(weird_elm), None); // Points between element 0 and 1
4589+
/// assert_eq!(arr.element_offset(ok_elm), Some(0)); // Points to element 0
4590+
/// assert_eq!(arr.element_offset(weird_elm), None); // Points between element 0 and 1
45914591
/// ```
45924592
#[must_use]
45934593
#[unstable(feature = "substr_range", issue = "126769")]
4594-
pub fn elem_offset(&self, element: &T) -> Option<usize> {
4594+
pub fn element_offset(&self, element: &T) -> Option<usize> {
45954595
if T::IS_ZST {
45964596
panic!("elements are zero-sized");
45974597
}

0 commit comments

Comments
 (0)