Skip to content

Commit

Permalink
Merge pull request #300 from rusty-snake/mountinfos-iter
Browse files Browse the repository at this point in the history
Add MountInfos::iter
  • Loading branch information
eminence authored Feb 3, 2024
2 parents 85ac3ee + 8c061d6 commit 7491fd3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions procfs-core/src/process/mount.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ bitflags! {
/// This data is taken from the `/proc/[pid]/mountinfo` file.
pub struct MountInfos(pub Vec<MountInfo>);

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

impl crate::FromBufRead for MountInfos {
fn from_buf_read<R: BufRead>(r: R) -> ProcResult<Self> {
let lines = r.lines();
Expand Down

0 comments on commit 7491fd3

Please sign in to comment.