mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-08 07:35:01 +03:00
Remove spurious lifetimes
Co-Authored-By: Max Brunsfeld <max@zed.dev>
This commit is contained in:
parent
55ca085d7d
commit
525d84e5bf
@ -2361,20 +2361,20 @@ pub trait ToOffset {
|
||||
}
|
||||
|
||||
impl ToOffset for Point {
|
||||
fn to_offset<'a>(&self, snapshot: &BufferSnapshot) -> usize {
|
||||
fn to_offset(&self, snapshot: &BufferSnapshot) -> usize {
|
||||
snapshot.point_to_offset(*self)
|
||||
}
|
||||
}
|
||||
|
||||
impl ToOffset for usize {
|
||||
fn to_offset<'a>(&self, snapshot: &BufferSnapshot) -> usize {
|
||||
fn to_offset(&self, snapshot: &BufferSnapshot) -> usize {
|
||||
assert!(*self <= snapshot.len(), "offset {self} is out of range");
|
||||
*self
|
||||
}
|
||||
}
|
||||
|
||||
impl ToOffset for Anchor {
|
||||
fn to_offset<'a>(&self, snapshot: &BufferSnapshot) -> usize {
|
||||
fn to_offset(&self, snapshot: &BufferSnapshot) -> usize {
|
||||
snapshot.summary_for_anchor(self)
|
||||
}
|
||||
}
|
||||
@ -2402,25 +2402,25 @@ pub trait ToPoint {
|
||||
}
|
||||
|
||||
impl ToPoint for Anchor {
|
||||
fn to_point<'a>(&self, snapshot: &BufferSnapshot) -> Point {
|
||||
fn to_point(&self, snapshot: &BufferSnapshot) -> Point {
|
||||
snapshot.summary_for_anchor(self)
|
||||
}
|
||||
}
|
||||
|
||||
impl ToPoint for usize {
|
||||
fn to_point<'a>(&self, snapshot: &BufferSnapshot) -> Point {
|
||||
fn to_point(&self, snapshot: &BufferSnapshot) -> Point {
|
||||
snapshot.offset_to_point(*self)
|
||||
}
|
||||
}
|
||||
|
||||
impl ToPoint for Point {
|
||||
fn to_point<'a>(&self, _: &BufferSnapshot) -> Point {
|
||||
fn to_point(&self, _: &BufferSnapshot) -> Point {
|
||||
*self
|
||||
}
|
||||
}
|
||||
|
||||
impl ToPoint for Unclipped<PointUtf16> {
|
||||
fn to_point<'a>(&self, snapshot: &BufferSnapshot) -> Point {
|
||||
fn to_point(&self, snapshot: &BufferSnapshot) -> Point {
|
||||
snapshot.unclipped_point_utf16_to_point(*self)
|
||||
}
|
||||
}
|
||||
@ -2430,25 +2430,25 @@ pub trait ToPointUtf16 {
|
||||
}
|
||||
|
||||
impl ToPointUtf16 for Anchor {
|
||||
fn to_point_utf16<'a>(&self, snapshot: &BufferSnapshot) -> PointUtf16 {
|
||||
fn to_point_utf16(&self, snapshot: &BufferSnapshot) -> PointUtf16 {
|
||||
snapshot.summary_for_anchor(self)
|
||||
}
|
||||
}
|
||||
|
||||
impl ToPointUtf16 for usize {
|
||||
fn to_point_utf16<'a>(&self, snapshot: &BufferSnapshot) -> PointUtf16 {
|
||||
fn to_point_utf16(&self, snapshot: &BufferSnapshot) -> PointUtf16 {
|
||||
snapshot.offset_to_point_utf16(*self)
|
||||
}
|
||||
}
|
||||
|
||||
impl ToPointUtf16 for PointUtf16 {
|
||||
fn to_point_utf16<'a>(&self, _: &BufferSnapshot) -> PointUtf16 {
|
||||
fn to_point_utf16(&self, _: &BufferSnapshot) -> PointUtf16 {
|
||||
*self
|
||||
}
|
||||
}
|
||||
|
||||
impl ToPointUtf16 for Point {
|
||||
fn to_point_utf16<'a>(&self, snapshot: &BufferSnapshot) -> PointUtf16 {
|
||||
fn to_point_utf16(&self, snapshot: &BufferSnapshot) -> PointUtf16 {
|
||||
snapshot.point_to_point_utf16(*self)
|
||||
}
|
||||
}
|
||||
@ -2458,19 +2458,19 @@ pub trait ToOffsetUtf16 {
|
||||
}
|
||||
|
||||
impl ToOffsetUtf16 for Anchor {
|
||||
fn to_offset_utf16<'a>(&self, snapshot: &BufferSnapshot) -> OffsetUtf16 {
|
||||
fn to_offset_utf16(&self, snapshot: &BufferSnapshot) -> OffsetUtf16 {
|
||||
snapshot.summary_for_anchor(self)
|
||||
}
|
||||
}
|
||||
|
||||
impl ToOffsetUtf16 for usize {
|
||||
fn to_offset_utf16<'a>(&self, snapshot: &BufferSnapshot) -> OffsetUtf16 {
|
||||
fn to_offset_utf16(&self, snapshot: &BufferSnapshot) -> OffsetUtf16 {
|
||||
snapshot.offset_to_offset_utf16(*self)
|
||||
}
|
||||
}
|
||||
|
||||
impl ToOffsetUtf16 for OffsetUtf16 {
|
||||
fn to_offset_utf16<'a>(&self, _snapshot: &BufferSnapshot) -> OffsetUtf16 {
|
||||
fn to_offset_utf16(&self, _snapshot: &BufferSnapshot) -> OffsetUtf16 {
|
||||
*self
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user