Skip to content

Commit

Permalink
Require no context on SimpleSpan -> Range
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamin-cates committed Jan 29, 2025
1 parent 63e1792 commit eee2fc8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/span.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ pub struct SimpleSpan<T = usize, C = ()> {
impl<T, C> SimpleSpan<T, C> {
/// Convert this span into a [`std::ops::Range`].
pub fn into_range(self) -> Range<T> {
self.into()
self.start..self.end
}
}

Expand All @@ -111,8 +111,8 @@ impl<T> From<Range<T>> for SimpleSpan<T> {
}
}

impl<T, C> From<SimpleSpan<T, C>> for Range<T> {
fn from(span: SimpleSpan<T, C>) -> Self {
impl<T> From<SimpleSpan<T, ()>> for Range<T> {
fn from(span: SimpleSpan<T>) -> Self {
Range {
start: span.start,
end: span.end,
Expand Down Expand Up @@ -146,7 +146,7 @@ where
type Item = T;

fn into_iter(self) -> Self::IntoIter {
self.into()
self.start..self.end
}
}

Expand Down

0 comments on commit eee2fc8

Please sign in to comment.