Skip to content

Commit e9a6a0d

Browse files
CopilotCBenoit
andcommitted
Add allow attributes for test modules in win-api-wrappers
Silence unwrap_used and print_stdout warnings in test code using module-level allow attributes. Fix manual_contains warning by using Vec::contains() Co-authored-by: CBenoit <3809077+CBenoit@users.noreply.github.com>
1 parent 7dc767e commit e9a6a0d

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

crates/win-api-wrappers/src/security/privilege.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,9 @@ impl Drop for ScopedPrivileges<'_> {
240240

241241
#[cfg(test)]
242242
mod tests {
243+
#![allow(clippy::unwrap_used)]
244+
#![allow(clippy::print_stdout)]
245+
243246
use super::*;
244247

245248
#[test]
@@ -282,7 +285,7 @@ mod tests {
282285

283286
// Verify the attribute for the privilege has been adjusted.
284287
for privilege in privileges.token().privileges().unwrap().as_slice() {
285-
found = privileges.token_privileges.iter().any(|luid| privilege.Luid == *luid);
288+
found = privileges.token_privileges.contains(&privilege.Luid);
286289

287290
if found {
288291
assert_eq!(privilege.Attributes.0, 2);

crates/win-api-wrappers/src/token.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -938,6 +938,8 @@ impl FromWin32<Security::TOKEN_PRIMARY_GROUP> for TokenPrimaryGroup {
938938

939939
#[cfg(test)]
940940
mod tests {
941+
#![allow(clippy::unwrap_used)]
942+
941943
use super::*;
942944

943945
#[test]

0 commit comments

Comments
 (0)