refactor: eliminate code duplication in cursor operations and cleanup

This commit is contained in:
2025-05-30 22:29:24 -05:00
parent c1b8160f4a
commit bba65f2f97
2 changed files with 1 additions and 38 deletions
+1
View File
@@ -1,3 +1,4 @@
/target /target
**/*.rs.bk **/*.rs.bk
Cargo.lock Cargo.lock
CODE_CLEANUP_TODO.md
-38
View File
@@ -1,38 +0,0 @@
# Code Cleanup TODO
## 🔥 Critical Issues
### 1. Code Duplication
- [x] Extract cursor application logic from `select_cursor()` and `next_cursor()`
- [x] Extract cleanup logic from `quit_app()` and system tray quit handler
### 2. Steam Integration
- [ ] Replace `unwrap()` with proper error handling in `Steam::new()`- Leave this on the backburner for now
- [ ] App should work fine even if Steam is offline (Steam remembers inventory, we pull from Steam even in offline mode) - Leave this on the backburner for now
### 3. Unsafe Thread-Safety
- [ ] Document or fix `SyncHCURSOR` unsafe impls in `types.rs`
## 🚨 High Priority
### 4. Debug Logging Spam
- [ ] Remove 73 debug print statements from production code
- [ ] Add proper logging framework
### 5. Mutex Unwraps
- [ ] Replace 9 `lock().unwrap()` calls with proper error handling
### 6. Large Functions
- [ ] Break down `load_cursor_files()` (90+ lines)
- [ ] Break down `create_cursor_from_image()` (170+ lines)
## 📋 Medium Priority
### 7. Mock Data Fallbacks
- [ ] Remove hardcoded fallback cursors pointing to non-existent files
### 8. Inline Event Handlers
- [ ] Extract system tray/window event handlers from Tauri builder
### 9. Error Handling
- [ ] Standardize error types and handling patterns