Skip to content

Commit a2b4c9c

Browse files
committed
fix: clippy in gh actions fixes
1 parent f30909e commit a2b4c9c

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

tests/cli_functions.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ use uuid::Uuid;
66
fn test_get_user_rate_valid_ratings() {
77
let valid_ratings = vec![1u8, 2u8, 3u8, 4u8, 5u8];
88
for rating in valid_ratings {
9-
assert!(rating >= 1 && rating <= 5);
9+
assert!((1..=5).contains(&rating));
1010
}
1111
}
1212

1313
#[test]
1414
fn test_invalid_ratings_out_of_range() {
1515
let invalid_ratings = vec![0u8, 6u8, 10u8, 255u8];
1616
for rating in invalid_ratings {
17-
assert!(rating < 1 || rating > 5);
17+
assert!(!(1..=5).contains(&rating));
1818
}
1919
}
2020

@@ -27,14 +27,14 @@ fn test_orders_info_empty_order_ids() {
2727
#[test]
2828
fn test_orders_info_single_order_id() {
2929
let order_id = Uuid::new_v4();
30-
let order_ids = vec![order_id];
30+
let order_ids = [order_id];
3131
assert_eq!(order_ids.len(), 1);
3232
assert_eq!(order_ids[0], order_id);
3333
}
3434

3535
#[test]
3636
fn test_orders_info_multiple_order_ids() {
37-
let order_ids = vec![Uuid::new_v4(), Uuid::new_v4(), Uuid::new_v4()];
37+
let order_ids = [Uuid::new_v4(), Uuid::new_v4(), Uuid::new_v4()];
3838
assert_eq!(order_ids.len(), 3);
3939
assert_ne!(order_ids[0], order_ids[1]);
4040
assert_ne!(order_ids[1], order_ids[2]);
@@ -111,7 +111,7 @@ fn test_rating_payload_creation() {
111111
match payload {
112112
Payload::RatingUser(r) => {
113113
assert_eq!(r, rating);
114-
assert!(r >= 1 && r <= 5);
114+
assert!((1..=5).contains(&r));
115115
}
116116
_ => panic!("Expected Payload::RatingUser"),
117117
}

tests/parser_dms.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ async fn print_dms_with_multiple_messages() {
7878
let sender_keys = Keys::generate();
7979
let mut msgs = Vec::new();
8080

81-
let actions = vec![
81+
let actions = [
8282
Action::NewOrder,
8383
Action::PayInvoice,
8484
Action::FiatSent,

tests/parser_orders.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ fn parse_orders_different_amounts() {
253253
Status::Active,
254254
"USD",
255255
*amount,
256-
(*amount / 100) as i64,
256+
*amount / 100_i64,
257257
);
258258
events.insert(e);
259259
}

0 commit comments

Comments
 (0)