clippy: fix/allow identity_op

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2021-01-19 14:12:07 +01:00
parent e062ebbc29
commit 81281d04a4
2 changed files with 10 additions and 1 deletions

View File

@ -74,12 +74,14 @@ pub const ROLE_ADMIN: u64 = std::u64::MAX;
pub const ROLE_NO_ACCESS: u64 = 0; pub const ROLE_NO_ACCESS: u64 = 0;
#[rustfmt::skip] #[rustfmt::skip]
#[allow(clippy::identity_op)]
/// Audit can view configuration and status information, but not modify it. /// Audit can view configuration and status information, but not modify it.
pub const ROLE_AUDIT: u64 = 0 pub const ROLE_AUDIT: u64 = 0
| PRIV_SYS_AUDIT | PRIV_SYS_AUDIT
| PRIV_DATASTORE_AUDIT; | PRIV_DATASTORE_AUDIT;
#[rustfmt::skip] #[rustfmt::skip]
#[allow(clippy::identity_op)]
/// Datastore.Admin can do anything on the datastore. /// Datastore.Admin can do anything on the datastore.
pub const ROLE_DATASTORE_ADMIN: u64 = 0 pub const ROLE_DATASTORE_ADMIN: u64 = 0
| PRIV_DATASTORE_AUDIT | PRIV_DATASTORE_AUDIT
@ -90,6 +92,7 @@ pub const ROLE_DATASTORE_ADMIN: u64 = 0
| PRIV_DATASTORE_PRUNE; | PRIV_DATASTORE_PRUNE;
#[rustfmt::skip] #[rustfmt::skip]
#[allow(clippy::identity_op)]
/// Datastore.Reader can read/verify datastore content and do restore /// Datastore.Reader can read/verify datastore content and do restore
pub const ROLE_DATASTORE_READER: u64 = 0 pub const ROLE_DATASTORE_READER: u64 = 0
| PRIV_DATASTORE_AUDIT | PRIV_DATASTORE_AUDIT
@ -97,27 +100,32 @@ pub const ROLE_DATASTORE_READER: u64 = 0
| PRIV_DATASTORE_READ; | PRIV_DATASTORE_READ;
#[rustfmt::skip] #[rustfmt::skip]
#[allow(clippy::identity_op)]
/// Datastore.Backup can do backup and restore, but no prune. /// Datastore.Backup can do backup and restore, but no prune.
pub const ROLE_DATASTORE_BACKUP: u64 = 0 pub const ROLE_DATASTORE_BACKUP: u64 = 0
| PRIV_DATASTORE_BACKUP; | PRIV_DATASTORE_BACKUP;
#[rustfmt::skip] #[rustfmt::skip]
#[allow(clippy::identity_op)]
/// Datastore.PowerUser can do backup, restore, and prune. /// Datastore.PowerUser can do backup, restore, and prune.
pub const ROLE_DATASTORE_POWERUSER: u64 = 0 pub const ROLE_DATASTORE_POWERUSER: u64 = 0
| PRIV_DATASTORE_PRUNE | PRIV_DATASTORE_PRUNE
| PRIV_DATASTORE_BACKUP; | PRIV_DATASTORE_BACKUP;
#[rustfmt::skip] #[rustfmt::skip]
#[allow(clippy::identity_op)]
/// Datastore.Audit can audit the datastore. /// Datastore.Audit can audit the datastore.
pub const ROLE_DATASTORE_AUDIT: u64 = 0 pub const ROLE_DATASTORE_AUDIT: u64 = 0
| PRIV_DATASTORE_AUDIT; | PRIV_DATASTORE_AUDIT;
#[rustfmt::skip] #[rustfmt::skip]
#[allow(clippy::identity_op)]
/// Remote.Audit can audit the remote /// Remote.Audit can audit the remote
pub const ROLE_REMOTE_AUDIT: u64 = 0 pub const ROLE_REMOTE_AUDIT: u64 = 0
| PRIV_REMOTE_AUDIT; | PRIV_REMOTE_AUDIT;
#[rustfmt::skip] #[rustfmt::skip]
#[allow(clippy::identity_op)]
/// Remote.Admin can do anything on the remote. /// Remote.Admin can do anything on the remote.
pub const ROLE_REMOTE_ADMIN: u64 = 0 pub const ROLE_REMOTE_ADMIN: u64 = 0
| PRIV_REMOTE_AUDIT | PRIV_REMOTE_AUDIT
@ -125,6 +133,7 @@ pub const ROLE_REMOTE_ADMIN: u64 = 0
| PRIV_REMOTE_READ; | PRIV_REMOTE_READ;
#[rustfmt::skip] #[rustfmt::skip]
#[allow(clippy::identity_op)]
/// Remote.SyncOperator can do read and prune on the remote. /// Remote.SyncOperator can do read and prune on the remote.
pub const ROLE_REMOTE_SYNC_OPERATOR: u64 = 0 pub const ROLE_REMOTE_SYNC_OPERATOR: u64 = 0
| PRIV_REMOTE_AUDIT | PRIV_REMOTE_AUDIT

View File

@ -104,7 +104,7 @@ impl LogRotate {
for i in (0..count-1).rev() { for i in (0..count-1).rev() {
if self.compress if self.compress
&& filenames[i+0].extension() != Some(std::ffi::OsStr::new("zst")) && filenames[i].extension() != Some(std::ffi::OsStr::new("zst"))
&& filenames[i+1].extension() == Some(std::ffi::OsStr::new("zst")) && filenames[i+1].extension() == Some(std::ffi::OsStr::new("zst"))
{ {
Self::compress(&filenames[i], &filenames[i+1], &options)?; Self::compress(&filenames[i], &filenames[i+1], &options)?;