Skip to content

Add MountInfos::iter#300

Merged
eminence merged 1 commit intoeminence:masterfrom
rusty-snake:mountinfos-iter
Feb 3, 2024
Merged

Add MountInfos::iter#300
eminence merged 1 commit intoeminence:masterfrom
rusty-snake:mountinfos-iter

Conversation

@rusty-snake
Copy link
Contributor

This is a convenience for mountinfo.0.iter().

This is a convenience for mountinfo.0.iter().

impl MountInfos {
/// Returns an borrowed iterator.
pub fn iter(&self) -> std::slice::Iter<'_, MountInfo> {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a minor point, but I wonder if we could do:

Suggested change
pub fn iter(&self) -> std::slice::Iter<'_, MountInfo> {
pub fn iter(&self) -> impl Iterator<Item = &MountInfo> {

to hide the std::slice::Iter concrete type. In practice this doesn't matter much because the inner Vec is part of the public API of MountInfos (and so std::slice::Iter is kind of part of this API too)

@eminence
Copy link
Owner

eminence commented Feb 3, 2024

LGTM, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants