Skip to content

Commit 80cff3b

Browse files
committed
Address clippy::bool_assert_comparison
1 parent d1b2b9b commit 80cff3b

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

src/tests/krate/yanking.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ impl crate::util::MockCookieUser {
4040
}
4141

4242
#[test]
43+
#[allow(clippy::bool_assert_comparison)] // for claim::assert_some_eq! with bool
4344
fn yank_works_as_intended() {
4445
let (app, anon, cookie, token) = TestApp::full().with_token();
4546

src/tests/user.rs

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ fn following() {
250250

251251
let r: R = user.get("/api/v1/me/updates").good();
252252
assert_eq!(r.versions.len(), 0);
253-
assert_eq!(r.meta.more, false);
253+
assert!(!r.meta.more);
254254

255255
user.put::<OkBool>("/api/v1/crates/foo_fighters/follow", b"")
256256
.good();
@@ -259,7 +259,7 @@ fn following() {
259259

260260
let r: R = user.get("/api/v1/me/updates").good();
261261
assert_eq!(r.versions.len(), 2);
262-
assert_eq!(r.meta.more, false);
262+
assert!(!r.meta.more);
263263
let foo_version = r
264264
.versions
265265
.iter()
@@ -280,15 +280,15 @@ fn following() {
280280
.get_with_query("/api/v1/me/updates", "per_page=1")
281281
.good();
282282
assert_eq!(r.versions.len(), 1);
283-
assert_eq!(r.meta.more, true);
283+
assert!(r.meta.more);
284284

285285
user.delete::<OkBool>("/api/v1/crates/bar_fighters/follow")
286286
.good();
287287
let r: R = user
288288
.get_with_query("/api/v1/me/updates", "page=2&per_page=1")
289289
.good();
290290
assert_eq!(r.versions.len(), 0);
291-
assert_eq!(r.meta.more, false);
291+
assert!(!r.meta.more);
292292

293293
let response = user.get_with_query::<()>("/api/v1/me/updates", "page=0");
294294
assert_eq!(response.status(), StatusCode::BAD_REQUEST);
@@ -663,21 +663,20 @@ fn test_update_email_notifications() {
663663
}]);
664664
let json = user.show_me();
665665

666-
assert_eq!(
667-
json.owned_crates
666+
assert!(
667+
!json
668+
.owned_crates
668669
.iter()
669670
.find(|c| c.id == a_id)
670671
.unwrap()
671-
.email_notifications,
672-
false
672+
.email_notifications
673673
);
674-
assert_eq!(
674+
assert!(
675675
json.owned_crates
676676
.iter()
677677
.find(|c| c.id == b_id)
678678
.unwrap()
679-
.email_notifications,
680-
true
679+
.email_notifications
681680
);
682681

683682
// Update crate_b: email_notifications = false
@@ -688,21 +687,21 @@ fn test_update_email_notifications() {
688687
}]);
689688
let json = user.show_me();
690689

691-
assert_eq!(
692-
json.owned_crates
690+
assert!(
691+
!json
692+
.owned_crates
693693
.iter()
694694
.find(|c| c.id == a_id)
695695
.unwrap()
696-
.email_notifications,
697-
false
696+
.email_notifications
698697
);
699-
assert_eq!(
700-
json.owned_crates
698+
assert!(
699+
!json
700+
.owned_crates
701701
.iter()
702702
.find(|c| c.id == b_id)
703703
.unwrap()
704-
.email_notifications,
705-
false
704+
.email_notifications
706705
);
707706

708707
// Update crate_a and crate_b: email_notifications = true

0 commit comments

Comments
 (0)