Skip to content

Commit

Permalink
Change Generics iterator methods to return RPIT
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Aug 11, 2024
1 parent ac9e1dd commit e5e9927
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/generics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ impl Generics {
/// style="padding-left:0;padding-right:0;">LifetimeParam</code></a><code
/// style="padding-left:0;">&gt;</code>
/// over the lifetime parameters in `self.params`.
pub fn lifetimes(&self) -> Lifetimes {
pub fn lifetimes(&self) -> impl Iterator<Item = &LifetimeParam> {
Lifetimes(self.params.iter())
}

Expand All @@ -121,7 +121,7 @@ impl Generics {
/// style="padding-left:0;padding-right:0;">LifetimeParam</code></a><code
/// style="padding-left:0;">&gt;</code>
/// over the lifetime parameters in `self.params`.
pub fn lifetimes_mut(&mut self) -> LifetimesMut {
pub fn lifetimes_mut(&mut self) -> impl Iterator<Item = &mut LifetimeParam> {
LifetimesMut(self.params.iter_mut())
}

Expand All @@ -132,7 +132,7 @@ impl Generics {
/// style="padding-left:0;padding-right:0;">TypeParam</code></a><code
/// style="padding-left:0;">&gt;</code>
/// over the type parameters in `self.params`.
pub fn type_params(&self) -> TypeParams {
pub fn type_params(&self) -> impl Iterator<Item = &TypeParam> {
TypeParams(self.params.iter())
}

Expand All @@ -143,7 +143,7 @@ impl Generics {
/// style="padding-left:0;padding-right:0;">TypeParam</code></a><code
/// style="padding-left:0;">&gt;</code>
/// over the type parameters in `self.params`.
pub fn type_params_mut(&mut self) -> TypeParamsMut {
pub fn type_params_mut(&mut self) -> impl Iterator<Item = &mut TypeParam> {
TypeParamsMut(self.params.iter_mut())
}

Expand All @@ -154,7 +154,7 @@ impl Generics {
/// style="padding-left:0;padding-right:0;">ConstParam</code></a><code
/// style="padding-left:0;">&gt;</code>
/// over the constant parameters in `self.params`.
pub fn const_params(&self) -> ConstParams {
pub fn const_params(&self) -> impl Iterator<Item = &ConstParam> {
ConstParams(self.params.iter())
}

Expand All @@ -165,7 +165,7 @@ impl Generics {
/// style="padding-left:0;padding-right:0;">ConstParam</code></a><code
/// style="padding-left:0;">&gt;</code>
/// over the constant parameters in `self.params`.
pub fn const_params_mut(&mut self) -> ConstParamsMut {
pub fn const_params_mut(&mut self) -> impl Iterator<Item = &mut ConstParam> {
ConstParamsMut(self.params.iter_mut())
}

Expand Down

0 comments on commit e5e9927

Please sign in to comment.