From d87aead3c0bf81f67040e1831d227429af45ae94 Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Sun, 19 May 2024 01:50:50 +0700 Subject: [PATCH] chore: edit more comments about clippy --- .github/workflows/ci.yml | 3 +-- src/internals/c.rs | 4 ++-- src/internals/helpers.rs | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1039eab4..6bc227f8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -139,8 +139,7 @@ jobs: rustup toolchain install nightly -c clippy rustup default nightly - run: cargo fetch - - run: cargo clippy --all-targets --all-features -- -Dwarnings -A clippy::assertions-on-constants - + - run: cargo clippy --all-targets --all-features -- -Dwarnings # Use static analyzer Rudra . # FIXME: Disable for now since it's very costly to run. diff --git a/src/internals/c.rs b/src/internals/c.rs index 7ddfc798..3cd1ee1f 100644 --- a/src/internals/c.rs +++ b/src/internals/c.rs @@ -30,12 +30,11 @@ pub use windows_sys::Win32::System::IO::DeviceIoControl; // Makes sure layout of RawHandle and windows-sys's HANDLE are the same // for pointer casts between them. -// CLIPPY: nonsense suggestions for assert! #[allow(clippy::unnecessary_operation)] const _: () = { let std_layout = Layout::new::(); let win_sys_layout = Layout::new::(); - // MSVR(Rust v1.57): use assert! instead + // MSRV(Rust v1.57): use assert! instead [(); 1][std_layout.size() - win_sys_layout.size()]; [(); 1][std_layout.align() - win_sys_layout.align()]; }; @@ -49,6 +48,7 @@ pub const REPARSE_GUID_DATA_BUFFER_HEADER_SIZE: u16 = 24; pub const MOUNT_POINT_REPARSE_BUFFER_HEADER_SIZE: u16 = 8; #[cfg(feature = "nightly")] +#[allow(clippy::assertions_on_constants)] const _: () = { assert!(REPARSE_DATA_BUFFER_HEADER_SIZE == nightly::REPARSE_DATA_BUFFER_HEADER_SIZE); assert!(REPARSE_GUID_DATA_BUFFER_HEADER_SIZE == nightly::REPARSE_GUID_DATA_BUFFER_HEADER_SIZE); diff --git a/src/internals/helpers.rs b/src/internals/helpers.rs index 7b74c538..c2ce23d0 100644 --- a/src/internals/helpers.rs +++ b/src/internals/helpers.rs @@ -50,7 +50,7 @@ fn set_privilege(write: bool) -> io::Result<()> { c::SE_BACKUP_NAME } } else { - // FSCTL_SET_REPARSE_POINT requires SE_CREATE_SYMBOLIC_LINK_NAME privilege + // FSCTL_SET_REPARSE_POINT requires below privilege. // Ref c::SE_CREATE_SYMBOLIC_LINK_NAME };