Skip to content

Commit

Permalink
chore: edit more comments about clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
tesuji committed May 31, 2024
1 parent c3d6518 commit 408f562
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://github.com/sslab-gatech/Rudra>.
# FIXME: Disable for now since it's very costly to run.
Expand Down
4 changes: 2 additions & 2 deletions src/internals/c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<RawHandle>();
let win_sys_layout = Layout::new::<HANDLE>();
// 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()];
};
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/internals/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://learn.microsoft.com/en-us/windows/win32/api/winioctl/ni-winioctl-fsctl_set_reparse_point>
c::SE_CREATE_SYMBOLIC_LINK_NAME
};
Expand Down

0 comments on commit 408f562

Please sign in to comment.