sys: enable CreateOptions::group_root/root_only

nix now has the required const fns

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2022-07-25 10:31:35 +02:00
parent d3364e07fb
commit b84446a030

View File

@ -85,12 +85,8 @@ impl CreateOptions {
Ok(()) Ok(())
} }
// TODO: once 'nix' has `const fn` constructors for Uid and Gid we can enable these:
/*
/// Convenience shortcut around having to import `Gid` from nix. /// Convenience shortcut around having to import `Gid` from nix.
pub const fn group_root(self) -> Self { pub const fn group_root(self) -> Self {
// nix hasn't constified these yet, but it's just an alias to gid_t:
self.group(Gid::from_raw(0)) self.group(Gid::from_raw(0))
} }
@ -98,7 +94,6 @@ impl CreateOptions {
pub const fn root_only(self) -> Self { pub const fn root_only(self) -> Self {
self.owner_root().group_root() self.owner_root().group_root()
} }
*/
} }
/// Information about a mounted file system from statfs64 syscall /// Information about a mounted file system from statfs64 syscall