Skip to content

Commit d2bcd6d

Browse files
authored
fix: Remove unnecessary explicit lifetimes (#488)
1 parent f2c694b commit d2bcd6d

File tree

5 files changed

+28
-34
lines changed

5 files changed

+28
-34
lines changed

consumer/src/iterators.rs

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ impl<'a> FollowingSiblings<'a> {
4848
}
4949
}
5050

51-
impl<'a> Iterator for FollowingSiblings<'a> {
51+
impl Iterator for FollowingSiblings<'_> {
5252
type Item = NodeId;
5353

5454
fn next(&mut self) -> Option<Self::Item> {
@@ -76,7 +76,7 @@ impl<'a> Iterator for FollowingSiblings<'a> {
7676
}
7777
}
7878

79-
impl<'a> DoubleEndedIterator for FollowingSiblings<'a> {
79+
impl DoubleEndedIterator for FollowingSiblings<'_> {
8080
fn next_back(&mut self) -> Option<Self::Item> {
8181
if self.done {
8282
None
@@ -94,9 +94,9 @@ impl<'a> DoubleEndedIterator for FollowingSiblings<'a> {
9494
}
9595
}
9696

97-
impl<'a> ExactSizeIterator for FollowingSiblings<'a> {}
97+
impl ExactSizeIterator for FollowingSiblings<'_> {}
9898

99-
impl<'a> FusedIterator for FollowingSiblings<'a> {}
99+
impl FusedIterator for FollowingSiblings<'_> {}
100100

101101
/// An iterator that yields preceding siblings of a node.
102102
///
@@ -126,7 +126,7 @@ impl<'a> PrecedingSiblings<'a> {
126126
}
127127
}
128128

129-
impl<'a> Iterator for PrecedingSiblings<'a> {
129+
impl Iterator for PrecedingSiblings<'_> {
130130
type Item = NodeId;
131131

132132
fn next(&mut self) -> Option<Self::Item> {
@@ -156,7 +156,7 @@ impl<'a> Iterator for PrecedingSiblings<'a> {
156156
}
157157
}
158158

159-
impl<'a> DoubleEndedIterator for PrecedingSiblings<'a> {
159+
impl DoubleEndedIterator for PrecedingSiblings<'_> {
160160
fn next_back(&mut self) -> Option<Self::Item> {
161161
if self.done {
162162
None
@@ -174,9 +174,9 @@ impl<'a> DoubleEndedIterator for PrecedingSiblings<'a> {
174174
}
175175
}
176176

177-
impl<'a> ExactSizeIterator for PrecedingSiblings<'a> {}
177+
impl ExactSizeIterator for PrecedingSiblings<'_> {}
178178

179-
impl<'a> FusedIterator for PrecedingSiblings<'a> {}
179+
impl FusedIterator for PrecedingSiblings<'_> {}
180180

181181
fn next_filtered_sibling<'a>(
182182
node: Option<Node<'a>>,
@@ -297,8 +297,8 @@ impl<'a, Filter: Fn(&Node) -> FilterResult> Iterator for FollowingFilteredSiblin
297297
}
298298
}
299299

300-
impl<'a, Filter: Fn(&Node) -> FilterResult> DoubleEndedIterator
301-
for FollowingFilteredSiblings<'a, Filter>
300+
impl<Filter: Fn(&Node) -> FilterResult> DoubleEndedIterator
301+
for FollowingFilteredSiblings<'_, Filter>
302302
{
303303
fn next_back(&mut self) -> Option<Self::Item> {
304304
if self.done {
@@ -312,10 +312,7 @@ impl<'a, Filter: Fn(&Node) -> FilterResult> DoubleEndedIterator
312312
}
313313
}
314314

315-
impl<'a, Filter: Fn(&Node) -> FilterResult> FusedIterator
316-
for FollowingFilteredSiblings<'a, Filter>
317-
{
318-
}
315+
impl<Filter: Fn(&Node) -> FilterResult> FusedIterator for FollowingFilteredSiblings<'_, Filter> {}
319316

320317
/// An iterator that yields preceding siblings of a node according to the
321318
/// specified filter.
@@ -358,8 +355,8 @@ impl<'a, Filter: Fn(&Node) -> FilterResult> Iterator for PrecedingFilteredSiblin
358355
}
359356
}
360357

361-
impl<'a, Filter: Fn(&Node) -> FilterResult> DoubleEndedIterator
362-
for PrecedingFilteredSiblings<'a, Filter>
358+
impl<Filter: Fn(&Node) -> FilterResult> DoubleEndedIterator
359+
for PrecedingFilteredSiblings<'_, Filter>
363360
{
364361
fn next_back(&mut self) -> Option<Self::Item> {
365362
if self.done {
@@ -373,10 +370,7 @@ impl<'a, Filter: Fn(&Node) -> FilterResult> DoubleEndedIterator
373370
}
374371
}
375372

376-
impl<'a, Filter: Fn(&Node) -> FilterResult> FusedIterator
377-
for PrecedingFilteredSiblings<'a, Filter>
378-
{
379-
}
373+
impl<Filter: Fn(&Node) -> FilterResult> FusedIterator for PrecedingFilteredSiblings<'_, Filter> {}
380374

381375
/// An iterator that yields children of a node according to the specified
382376
/// filter.
@@ -417,7 +411,7 @@ impl<'a, Filter: Fn(&Node) -> FilterResult> Iterator for FilteredChildren<'a, Fi
417411
}
418412
}
419413

420-
impl<'a, Filter: Fn(&Node) -> FilterResult> DoubleEndedIterator for FilteredChildren<'a, Filter> {
414+
impl<Filter: Fn(&Node) -> FilterResult> DoubleEndedIterator for FilteredChildren<'_, Filter> {
421415
fn next_back(&mut self) -> Option<Self::Item> {
422416
if self.done {
423417
None
@@ -430,7 +424,7 @@ impl<'a, Filter: Fn(&Node) -> FilterResult> DoubleEndedIterator for FilteredChil
430424
}
431425
}
432426

433-
impl<'a, Filter: Fn(&Node) -> FilterResult> FusedIterator for FilteredChildren<'a, Filter> {}
427+
impl<Filter: Fn(&Node) -> FilterResult> FusedIterator for FilteredChildren<'_, Filter> {}
434428

435429
pub(crate) enum LabelledBy<'a, Filter: Fn(&Node) -> FilterResult> {
436430
FromDescendants(FilteredChildren<'a, Filter>),
@@ -460,7 +454,7 @@ impl<'a, Filter: Fn(&Node) -> FilterResult> Iterator for LabelledBy<'a, Filter>
460454
}
461455
}
462456

463-
impl<'a, Filter: Fn(&Node) -> FilterResult> DoubleEndedIterator for LabelledBy<'a, Filter> {
457+
impl<Filter: Fn(&Node) -> FilterResult> DoubleEndedIterator for LabelledBy<'_, Filter> {
464458
fn next_back(&mut self) -> Option<Self::Item> {
465459
match self {
466460
Self::FromDescendants(iter) => iter.next_back(),
@@ -471,7 +465,7 @@ impl<'a, Filter: Fn(&Node) -> FilterResult> DoubleEndedIterator for LabelledBy<'
471465
}
472466
}
473467

474-
impl<'a, Filter: Fn(&Node) -> FilterResult> FusedIterator for LabelledBy<'a, Filter> {}
468+
impl<Filter: Fn(&Node) -> FilterResult> FusedIterator for LabelledBy<'_, Filter> {}
475469

476470
#[cfg(test)]
477471
mod tests {

consumer/src/text.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,13 @@ impl<'a> InnerPosition<'a> {
177177
}
178178
}
179179

180-
impl<'a> PartialEq for InnerPosition<'a> {
180+
impl PartialEq for InnerPosition<'_> {
181181
fn eq(&self, other: &Self) -> bool {
182182
self.node.id() == other.node.id() && self.character_index == other.character_index
183183
}
184184
}
185185

186-
impl<'a> Eq for InnerPosition<'a> {}
186+
impl Eq for InnerPosition<'_> {}
187187

188188
#[derive(Clone, Copy)]
189189
pub struct Position<'a> {
@@ -455,15 +455,15 @@ impl<'a> Position<'a> {
455455
}
456456
}
457457

458-
impl<'a> PartialEq for Position<'a> {
458+
impl PartialEq for Position<'_> {
459459
fn eq(&self, other: &Self) -> bool {
460460
self.root_node.id() == other.root_node.id() && self.inner == other.inner
461461
}
462462
}
463463

464-
impl<'a> Eq for Position<'a> {}
464+
impl Eq for Position<'_> {}
465465

466-
impl<'a> PartialOrd for Position<'a> {
466+
impl PartialOrd for Position<'_> {
467467
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
468468
if self.root_node.id() != other.root_node.id() {
469469
return None;
@@ -742,13 +742,13 @@ impl<'a> Range<'a> {
742742
}
743743
}
744744

745-
impl<'a> PartialEq for Range<'a> {
745+
impl PartialEq for Range<'_> {
746746
fn eq(&self, other: &Self) -> bool {
747747
self.node.id() == other.node.id() && self.start == other.start && self.end == other.end
748748
}
749749
}
750750

751-
impl<'a> Eq for Range<'a> {}
751+
impl Eq for Range<'_> {}
752752

753753
#[derive(Clone, Debug, PartialEq, Eq)]
754754
pub struct WeakRange {

platforms/atspi-common/src/node.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ use crate::{
3434

3535
pub(crate) struct NodeWrapper<'a>(pub(crate) &'a Node<'a>);
3636

37-
impl<'a> NodeWrapper<'a> {
37+
impl NodeWrapper<'_> {
3838
pub(crate) fn name(&self) -> Option<String> {
3939
if self.0.label_comes_from_value() {
4040
self.0.value()

platforms/macos/src/node.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ pub(crate) enum Value {
298298

299299
pub(crate) struct NodeWrapper<'a>(pub(crate) &'a Node<'a>);
300300

301-
impl<'a> NodeWrapper<'a> {
301+
impl NodeWrapper<'_> {
302302
fn is_root(&self) -> bool {
303303
self.0.is_root()
304304
}

platforms/windows/src/node.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ fn runtime_id_from_node_id(id: NodeId) -> [i32; RUNTIME_ID_SIZE] {
4343

4444
pub(crate) struct NodeWrapper<'a>(pub(crate) &'a Node<'a>);
4545

46-
impl<'a> NodeWrapper<'a> {
46+
impl NodeWrapper<'_> {
4747
fn control_type(&self) -> UIA_CONTROLTYPE_ID {
4848
let role = self.0.role();
4949
// TODO: Handle special cases. (#14)

0 commit comments

Comments
 (0)