Skip to content
This repository was archived by the owner on Jul 10, 2023. It is now read-only.

Commit 0b15440

Browse files
GetfdFlags -> GetFdFlags
It seems more intuitive, going off the fact that that's what I typed in the examples.
1 parent ad0d303 commit 0b15440

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/linux.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ use std::os::linux::process::PidFd as StdPidFd;
1515
/// Currently, there are no flags.
1616
#[derive(Clone, Copy)]
1717
#[non_exhaustive]
18-
pub struct GetfdFlags;
18+
pub struct GetFdFlags;
1919

20-
impl GetfdFlags {
20+
impl GetFdFlags {
2121
pub const fn empty() -> Self {
2222
Self
2323
}
@@ -29,18 +29,18 @@ impl GetfdFlags {
2929

3030
/// An extension trait to provide a convenient interface to [`get_file_from_pidfd`].
3131
pub trait PidFdExt {
32-
fn get_file(&self, target_fd: RawFd, flags: GetfdFlags) -> IoResult<File>;
32+
fn get_file(&self, target_fd: RawFd, flags: GetFdFlags) -> IoResult<File>;
3333
}
3434

3535
impl PidFdExt for PidFd {
36-
fn get_file(&self, target_fd: RawFd, flags: GetfdFlags) -> IoResult<File> {
36+
fn get_file(&self, target_fd: RawFd, flags: GetFdFlags) -> IoResult<File> {
3737
get_file_from_pidfd(self.as_raw_fd(), target_fd, flags)
3838
}
3939
}
4040

4141
#[cfg(feature = "nightly")]
4242
impl PidFdExt for StdPidFd {
43-
fn get_file(&self, target_fd: RawFd, flags: GetfdFlags) -> IoResult<File> {
43+
fn get_file(&self, target_fd: RawFd, flags: GetFdFlags) -> IoResult<File> {
4444
get_file_from_pidfd(self.as_raw_fd(), target_fd, flags)
4545
}
4646
}
@@ -54,7 +54,7 @@ impl PidFdExt for StdPidFd {
5454
/// see the man page for [`pidfd_getfd(2)`].
5555
///
5656
/// [`pidfd_getfd(2)`]: https://man7.org/linux/man-pages/man2/pidfd_getfd.2.html
57-
pub fn get_file_from_pidfd(pidfd: RawFd, target_fd: RawFd, flags: GetfdFlags) -> IoResult<File> {
57+
pub fn get_file_from_pidfd(pidfd: RawFd, target_fd: RawFd, flags: GetFdFlags) -> IoResult<File> {
5858
// SAFETY: `flags` being 0 seems to be the only safety invariant for now.
5959
// Invalid fds return errors.
6060
let res = unsafe { pidfd_getfd(pidfd, target_fd, flags.bits()) };

0 commit comments

Comments
 (0)