Skip to content

Commit 01c11d0

Browse files
wr7gitbot
authored and
gitbot
committed
Rename elem_offset to element_offset
1 parent 535e420 commit 01c11d0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

core/src/slice/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -4661,7 +4661,7 @@ impl<T> [T] {
46614661
/// let num = &nums[2];
46624662
///
46634663
/// assert_eq!(num, &1);
4664-
/// assert_eq!(nums.elem_offset(num), Some(2));
4664+
/// assert_eq!(nums.element_offset(num), Some(2));
46654665
/// ```
46664666
/// Returning `None` with an in-between element:
46674667
/// ```
@@ -4676,12 +4676,12 @@ impl<T> [T] {
46764676
/// assert_eq!(ok_elm, &[0, 1]);
46774677
/// assert_eq!(weird_elm, &[1, 2]);
46784678
///
4679-
/// assert_eq!(arr.elem_offset(ok_elm), Some(0)); // Points to element 0
4680-
/// assert_eq!(arr.elem_offset(weird_elm), None); // Points between element 0 and 1
4679+
/// assert_eq!(arr.element_offset(ok_elm), Some(0)); // Points to element 0
4680+
/// assert_eq!(arr.element_offset(weird_elm), None); // Points between element 0 and 1
46814681
/// ```
46824682
#[must_use]
46834683
#[unstable(feature = "substr_range", issue = "126769")]
4684-
pub fn elem_offset(&self, element: &T) -> Option<usize> {
4684+
pub fn element_offset(&self, element: &T) -> Option<usize> {
46854685
if T::IS_ZST {
46864686
panic!("elements are zero-sized");
46874687
}

0 commit comments

Comments
 (0)