Skip to content

Commit 5c81e47

Browse files
authored
rename SlicePointer --> PointerIndex (#92)
1 parent c694765 commit 5c81e47

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/pointer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use alloc::{
77
vec::Vec,
88
};
99
use core::{borrow::Borrow, cmp::Ordering, ops::Deref, str::FromStr};
10-
use slice::SlicePointer;
10+
use slice::PointerIndex;
1111

1212
mod slice;
1313

@@ -320,7 +320,7 @@ impl Pointer {
320320
/// ```
321321
pub fn get<'p, I>(&'p self, index: I) -> Option<I::Output>
322322
where
323-
I: SlicePointer<'p>,
323+
I: PointerIndex<'p>,
324324
{
325325
index.get(self)
326326
}

src/pointer/slice.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@ use super::Pointer;
22
use crate::Token;
33
use core::ops::Bound;
44

5-
pub trait SlicePointer<'p>: private::Sealed {
5+
pub trait PointerIndex<'p>: private::Sealed {
66
type Output: 'p;
77

88
fn get(self, pointer: &'p Pointer) -> Option<Self::Output>;
99
}
1010

11-
impl<'p> SlicePointer<'p> for usize {
11+
impl<'p> PointerIndex<'p> for usize {
1212
type Output = Token<'p>;
1313

1414
fn get(self, pointer: &'p Pointer) -> Option<Self::Output> {
1515
pointer.tokens().nth(self)
1616
}
1717
}
1818

19-
impl<'p> SlicePointer<'p> for core::ops::Range<usize> {
19+
impl<'p> PointerIndex<'p> for core::ops::Range<usize> {
2020
type Output = &'p Pointer;
2121

2222
fn get(self, pointer: &'p Pointer) -> Option<Self::Output> {
@@ -56,7 +56,7 @@ impl<'p> SlicePointer<'p> for core::ops::Range<usize> {
5656
}
5757
}
5858

59-
impl<'p> SlicePointer<'p> for core::ops::RangeFrom<usize> {
59+
impl<'p> PointerIndex<'p> for core::ops::RangeFrom<usize> {
6060
type Output = &'p Pointer;
6161

6262
fn get(self, pointer: &'p Pointer) -> Option<Self::Output> {
@@ -81,7 +81,7 @@ impl<'p> SlicePointer<'p> for core::ops::RangeFrom<usize> {
8181
}
8282
}
8383

84-
impl<'p> SlicePointer<'p> for core::ops::RangeTo<usize> {
84+
impl<'p> PointerIndex<'p> for core::ops::RangeTo<usize> {
8585
type Output = &'p Pointer;
8686

8787
fn get(self, pointer: &'p Pointer) -> Option<Self::Output> {
@@ -114,15 +114,15 @@ impl<'p> SlicePointer<'p> for core::ops::RangeTo<usize> {
114114
}
115115
}
116116

117-
impl<'p> SlicePointer<'p> for core::ops::RangeFull {
117+
impl<'p> PointerIndex<'p> for core::ops::RangeFull {
118118
type Output = &'p Pointer;
119119

120120
fn get(self, pointer: &'p Pointer) -> Option<Self::Output> {
121121
Some(pointer)
122122
}
123123
}
124124

125-
impl<'p> SlicePointer<'p> for core::ops::RangeInclusive<usize> {
125+
impl<'p> PointerIndex<'p> for core::ops::RangeInclusive<usize> {
126126
type Output = &'p Pointer;
127127

128128
fn get(self, pointer: &'p Pointer) -> Option<Self::Output> {
@@ -160,7 +160,7 @@ impl<'p> SlicePointer<'p> for core::ops::RangeInclusive<usize> {
160160
}
161161
}
162162

163-
impl<'p> SlicePointer<'p> for core::ops::RangeToInclusive<usize> {
163+
impl<'p> PointerIndex<'p> for core::ops::RangeToInclusive<usize> {
164164
type Output = &'p Pointer;
165165

166166
fn get(self, pointer: &'p Pointer) -> Option<Self::Output> {
@@ -190,7 +190,7 @@ impl<'p> SlicePointer<'p> for core::ops::RangeToInclusive<usize> {
190190
}
191191
}
192192

193-
impl<'p> SlicePointer<'p> for (Bound<usize>, Bound<usize>) {
193+
impl<'p> PointerIndex<'p> for (Bound<usize>, Bound<usize>) {
194194
type Output = &'p Pointer;
195195

196196
fn get(self, pointer: &'p Pointer) -> Option<Self::Output> {

0 commit comments

Comments
 (0)