Skip to content

Commit a6cb17f

Browse files
authored
chore: Fix violations of elided_named_lifetimes (#18330)
I compile Zed from nightly build pretty often and I've noticed that we're getting a few hits on new rustc lint: rust-lang/rust#129207 Release Notes: - N/A
1 parent 9d197dd commit a6cb17f

File tree

7 files changed

+10
-10
lines changed

7 files changed

+10
-10
lines changed

crates/editor/src/display_map/crease_map.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ impl CreaseSnapshot {
6969
&'a self,
7070
range: Range<MultiBufferRow>,
7171
snapshot: &'a MultiBufferSnapshot,
72-
) -> impl '_ + Iterator<Item = &'a Crease> {
72+
) -> impl 'a + Iterator<Item = &'a Crease> {
7373
let start = snapshot.anchor_before(Point::new(range.start.0, 0));
7474
let mut cursor = self.creases.cursor::<ItemSummary>(snapshot);
7575
cursor.seek(&start, Bias::Left, snapshot);

crates/editor/src/editor.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11515,7 +11515,7 @@ impl Editor {
1151511515
&'a self,
1151611516
position: Anchor,
1151711517
buffer: &'a MultiBufferSnapshot,
11518-
) -> impl 'a + Iterator<Item = &Range<Anchor>> {
11518+
) -> impl 'a + Iterator<Item = &'a Range<Anchor>> {
1151911519
let read_highlights = self
1152011520
.background_highlights
1152111521
.get(&TypeId::of::<DocumentHighlightRead>())

crates/language/src/syntax_map.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,7 @@ impl SyntaxSnapshot {
794794
range: Range<usize>,
795795
buffer: &'a BufferSnapshot,
796796
query: fn(&Grammar) -> Option<&Query>,
797-
) -> SyntaxMapCaptures {
797+
) -> SyntaxMapCaptures<'a> {
798798
SyntaxMapCaptures::new(
799799
range.clone(),
800800
buffer.as_rope(),
@@ -808,7 +808,7 @@ impl SyntaxSnapshot {
808808
range: Range<usize>,
809809
buffer: &'a BufferSnapshot,
810810
query: fn(&Grammar) -> Option<&Query>,
811-
) -> SyntaxMapMatches {
811+
) -> SyntaxMapMatches<'a> {
812812
SyntaxMapMatches::new(
813813
range.clone(),
814814
buffer.as_rope(),
@@ -828,7 +828,7 @@ impl SyntaxSnapshot {
828828
range: Range<T>,
829829
buffer: &'a BufferSnapshot,
830830
include_hidden: bool,
831-
) -> impl 'a + Iterator<Item = SyntaxLayer> {
831+
) -> impl 'a + Iterator<Item = SyntaxLayer<'a>> {
832832
let start_offset = range.start.to_offset(buffer);
833833
let end_offset = range.end.to_offset(buffer);
834834
let start = buffer.anchor_before(start_offset);

crates/project/src/project.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3954,7 +3954,7 @@ impl Project {
39543954
pub fn supplementary_language_servers<'a>(
39553955
&'a self,
39563956
cx: &'a AppContext,
3957-
) -> impl '_ + Iterator<Item = (LanguageServerId, LanguageServerName)> {
3957+
) -> impl 'a + Iterator<Item = (LanguageServerId, LanguageServerName)> {
39583958
self.lsp_store.read(cx).supplementary_language_servers()
39593959
}
39603960

crates/sum_tree/src/sum_tree.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ impl<T: Item> SumTree<T> {
345345
Iter::new(self)
346346
}
347347

348-
pub fn cursor<'a, S>(&'a self, cx: &<T::Summary as Summary>::Context) -> Cursor<T, S>
348+
pub fn cursor<'a, S>(&'a self, cx: &<T::Summary as Summary>::Context) -> Cursor<'a, T, S>
349349
where
350350
S: Dimension<'a, T::Summary>,
351351
{
@@ -358,7 +358,7 @@ impl<T: Item> SumTree<T> {
358358
&'a self,
359359
cx: &<T::Summary as Summary>::Context,
360360
filter_node: F,
361-
) -> FilterCursor<F, T, U>
361+
) -> FilterCursor<'a, F, T, U>
362362
where
363363
F: FnMut(&T::Summary) -> bool,
364364
U: Dimension<'a, T::Summary>,

crates/sum_tree/src/tree_map.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ impl<K: Clone + Ord, V: Clone> TreeMap<K, V> {
105105
cursor.item().map(|item| (&item.key, &item.value))
106106
}
107107

108-
pub fn iter_from<'a>(&'a self, from: &'a K) -> impl Iterator<Item = (&K, &V)> + '_ {
108+
pub fn iter_from<'a>(&'a self, from: &'a K) -> impl Iterator<Item = (&'a K, &'a V)> + 'a {
109109
let mut cursor = self.0.cursor::<MapKeyRef<'_, K>>(&());
110110
let from_key = MapKeyRef(Some(from));
111111
cursor.seek(&from_key, Bias::Left, &());

crates/workspace/src/workspace.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2119,7 +2119,7 @@ impl Workspace {
21192119
pub fn items<'a>(
21202120
&'a self,
21212121
cx: &'a AppContext,
2122-
) -> impl 'a + Iterator<Item = &Box<dyn ItemHandle>> {
2122+
) -> impl 'a + Iterator<Item = &'a Box<dyn ItemHandle>> {
21232123
self.panes.iter().flat_map(|pane| pane.read(cx).items())
21242124
}
21252125

0 commit comments

Comments
 (0)