forked from proxmox-mirrors/proxmox
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:
parent
31ae72ba6a
commit
0f1b84e93c
@ -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
|
||||
#[derive(Clone, Default)]
|
||||
#[derive(Copy, Clone, Default)]
|
||||
pub struct CreateOptions {
|
||||
perm: Option<stat::Mode>,
|
||||
owner: Option<Uid>,
|
||||
|
Loading…
Reference in New Issue
Block a user