chore: clippy
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 52s
CI / Lint & Test (pull_request) Successful in 14m23s
CI / Build Linux (pull_request) Successful in 16m46s
CI / Build Windows (cross-compile) (pull_request) Successful in 26m47s

This commit is contained in:
2026-01-19 20:09:36 -08:00
parent 27f69cb308
commit bd0c348695
2 changed files with 8 additions and 3 deletions
+5 -3
View File
@@ -114,10 +114,12 @@ impl AchievementProgress {
}
}
#[cfg(test)]
pub fn take_newly_unlocked(&mut self) -> Vec<AchievementId> {
std::mem::take(&mut self.newly_unlocked)
}
#[cfg(test)]
pub fn is_unlocked(&self, achievement: &AchievementId) -> bool {
self.unlocked.contains(achievement)
}
@@ -647,7 +649,7 @@ pub fn check_achievements(
}
// Special first-time achievements
if stats.tools_usage.len() >= 1 && progress.unlock(AchievementId::FirstTool) {
if !stats.tools_usage.is_empty() && progress.unlock(AchievementId::FirstTool) {
newly_unlocked.push(AchievementId::FirstTool);
}
if stats.code_blocks_generated >= 1 && progress.unlock(AchievementId::FirstCodeBlock) {
@@ -697,7 +699,7 @@ pub fn check_achievements(
let weekday = session_start.weekday();
// Early bird - 5 AM to 7 AM
if hour >= 5 && hour <= 7 && progress.unlock(AchievementId::EarlyBird) {
if (5..=7).contains(&hour) && progress.unlock(AchievementId::EarlyBird) {
newly_unlocked.push(AchievementId::EarlyBird);
}
@@ -708,7 +710,7 @@ pub fn check_achievements(
}
// All nighter - 2 AM to 5 AM
if current_hour >= 2 && current_hour <= 5 && progress.unlock(AchievementId::AllNighter) {
if (2..=5).contains(&current_hour) && progress.unlock(AchievementId::AllNighter) {
newly_unlocked.push(AchievementId::AllNighter);
}
+3
View File
@@ -90,6 +90,7 @@ impl WslBridge {
}
}
#[allow(dead_code)]
pub async fn new_with_loaded_achievements(app: &tauri::AppHandle) -> Self {
let bridge = Self::new();
@@ -354,10 +355,12 @@ impl WslBridge {
self.stats.read().clone()
}
#[allow(dead_code)]
pub fn update_stats(&mut self, input_tokens: u64, output_tokens: u64, model: &str) {
self.stats.write().add_usage(input_tokens, output_tokens, model);
}
#[allow(dead_code)]
pub fn reset_session_stats(&mut self) {
self.stats.write().reset_session();
}