Skip to content

Commit

Permalink
Give Fields::members an impl-Trait return type
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Aug 11, 2024
1 parent d94d5b0 commit 321839c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,8 @@ mod iter_member {
/// Get an iterator over the fields of a struct or variant as [`Member`]s.
/// This iterator can be used to iterate over a named or unnamed struct or
/// variant's fields uniformly.
///
/// The return type can considered as impl [`Iterator<Item = Member>`].
#[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))]
pub fn members(&self) -> IterMember {
pub fn members(&self) -> impl Iterator<Item = Member> + '_ {
IterMember {
iter: self.iter(),
unnamed_counter: 0,
Expand Down

0 comments on commit 321839c

Please sign in to comment.