Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
hpeebles committed Jul 24, 2024
1 parent d55b91a commit 0ab452e
Showing 1 changed file with 41 additions and 37 deletions.
78 changes: 41 additions & 37 deletions backend/canisters/user/impl/src/model/chit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,44 +171,48 @@ mod tests {
}

fn init_test_data() -> ChitEarnedEvents {
let events = vec![
ChitEarned {
amount: 200,
timestamp: 10,
reason: ChitEarnedReason::DailyClaim,
},
ChitEarned {
amount: 200,
timestamp: 11,
reason: ChitEarnedReason::DailyClaim,
},
ChitEarned {
amount: 300,
timestamp: 12,
reason: ChitEarnedReason::DailyClaim,
},
ChitEarned {
amount: 500,
timestamp: 13,
reason: ChitEarnedReason::Achievement(Achievement::SetBio),
},
ChitEarned {
amount: 300,
timestamp: 14,
reason: ChitEarnedReason::DailyClaim,
},
ChitEarned {
amount: 500,
timestamp: 15,
reason: ChitEarnedReason::Achievement(Achievement::SetAvatar),
},
ChitEarned {
amount: 500,
timestamp: 16,
reason: ChitEarnedReason::Achievement(Achievement::SentDirectMessage),
},
];
let total_chit_earned = events.iter().map(|e| e.amount).sum();

ChitEarnedEvents {
events: vec![
ChitEarned {
amount: 200,
timestamp: 10,
reason: ChitEarnedReason::DailyClaim,
},
ChitEarned {
amount: 200,
timestamp: 11,
reason: ChitEarnedReason::DailyClaim,
},
ChitEarned {
amount: 300,
timestamp: 12,
reason: ChitEarnedReason::DailyClaim,
},
ChitEarned {
amount: 500,
timestamp: 13,
reason: ChitEarnedReason::Achievement(Achievement::SetBio),
},
ChitEarned {
amount: 300,
timestamp: 14,
reason: ChitEarnedReason::DailyClaim,
},
ChitEarned {
amount: 500,
timestamp: 15,
reason: ChitEarnedReason::Achievement(Achievement::SetAvatar),
},
ChitEarned {
amount: 500,
timestamp: 16,
reason: ChitEarnedReason::Achievement(Achievement::SentDirectMessage),
},
],
events,
total_chit_earned,
}
}
}

0 comments on commit 0ab452e

Please sign in to comment.