Remove lifetime parameter from TextDimension trait

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
This commit is contained in:
Antonio Scandurra 2021-12-07 16:52:15 +01:00 committed by Max Brunsfeld
parent 6a44a7448e
commit a88cff4fa0
6 changed files with 39 additions and 51 deletions

View file

@ -117,7 +117,7 @@ impl Anchor {
pub fn summary<'a, D>(&self, content: &'a BufferSnapshot) -> D
where
D: TextDimension<'a>,
D: TextDimension,
{
content.summary_for_anchor(self)
}
@ -137,7 +137,7 @@ impl<T> AnchorMap<T> {
snapshot: &'a BufferSnapshot,
) -> impl Iterator<Item = (D, &'a T)> + 'a
where
D: 'a + TextDimension<'a>,
D: TextDimension,
{
snapshot
.summaries_for_anchors(
@ -160,7 +160,7 @@ impl AnchorSet {
pub fn iter<'a, D>(&'a self, content: &'a BufferSnapshot) -> impl Iterator<Item = D> + 'a
where
D: 'a + TextDimension<'a>,
D: TextDimension,
{
self.0.iter(content).map(|(position, _)| position)
}
@ -194,7 +194,7 @@ impl<T> AnchorRangeMap<T> {
content: &'a BufferSnapshot,
) -> impl Iterator<Item = (Range<D>, &'a T)> + 'a
where
D: 'a + TextDimension<'a>,
D: TextDimension,
{
content
.summaries_for_anchor_ranges(
@ -212,7 +212,7 @@ impl<T> AnchorRangeMap<T> {
content: &'a BufferSnapshot,
) -> impl Iterator<Item = (Range<D>, &'a T)> + 'a
where
D: 'a + TextDimension<'a>,
D: TextDimension,
I: ToOffset,
{
let range = content.anchor_at(range.start.0, range.start.1)
@ -250,7 +250,7 @@ impl<T> AnchorRangeMap<T> {
mut extract_key: F,
) -> Option<(Range<D>, &T)>
where
D: 'a + TextDimension<'a>,
D: TextDimension,
F: FnMut(&T) -> K,
K: Ord,
{
@ -266,7 +266,7 @@ impl<T> AnchorRangeMap<T> {
mut extract_key: F,
) -> Option<(Range<D>, &T)>
where
D: 'a + TextDimension<'a>,
D: TextDimension,
F: FnMut(&T) -> K,
K: Ord,
{
@ -282,7 +282,7 @@ impl<T> AnchorRangeMap<T> {
content: &'a BufferSnapshot,
) -> Range<D>
where
D: 'a + TextDimension<'a>,
D: TextDimension,
{
let mut anchor = Anchor {
full_offset: range.start,
@ -342,7 +342,7 @@ impl AnchorRangeSet {
content: &'a BufferSnapshot,
) -> impl 'a + Iterator<Item = Range<Point>>
where
D: 'a + TextDimension<'a>,
D: TextDimension,
{
self.0.ranges(content).map(|(range, _)| range)
}