sys: fs: derive Copy for CreateOptions

Pretty much all functions accepting `CreateOptions` take a value and not
a reference, so I've found myself using `.clone()` quite often in code
I've written recently.
The struct is only 24 bytes large (verified by a
`std::mem::size_of::<CreateOptions>()`), so it should be absolutely fine
to just derive Copy for it.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
This commit is contained in:
Lukas Wagner 2025-01-29 10:17:39 +01:00 committed by Thomas Lamprecht
parent 31ae72ba6a
commit 0f1b84e93c

View File

@ -30,7 +30,7 @@ pub fn fchown(fd: RawFd, owner: Option<Uid>, group: Option<Gid>) -> Result<(), E
} }
/// Define permissions, owner and group when creating files/dirs /// Define permissions, owner and group when creating files/dirs
#[derive(Clone, Default)] #[derive(Copy, Clone, Default)]
pub struct CreateOptions { pub struct CreateOptions {
perm: Option<stat::Mode>, perm: Option<stat::Mode>,
owner: Option<Uid>, owner: Option<Uid>,