Commit Graph

7 Commits

Author SHA1 Message Date
Jeremiah Russell
357da7f23b 🐛 fix(eol_rule): correct calculate_for_date and add logging
- Fix the EOL date calculation by using checked_sub_signed to prevent panics
- Add debug logging to track message age, delta, and deadline calculations
- Corrected test case to account for new calculation and added logger to test
2025-10-29 13:51:18 +00:00
Jeremiah Russell
4f87647339 🐛 fix(rules): correct grammar and improve date calculation
- correct a grammatical error in a comment
- add logging for debugging date calculations
- add a new test case for 1032 days to ensure correct calculation
2025-10-29 13:51:18 +00:00
Jeremiah Russell
2b420e53cb style: format code with rustfmt 2025-10-19 08:52:23 +01:00
Jeremiah Russell
a43eb9e4a2 refactor(rules): replace unwrap() with explicit error handling and propagate errors safely
- Replace Option::unwrap() with pattern matching in add_rule label check
- Handle home directory resolution failures with proper Error types
- Add directory creation in save() to ensure parent directories exist
- Replace chrono unwraps with ? operator for date calculations
- Use unwrap_or with sensible defaults for parsing edge cases
- Keep unwrap in test code where immediate failure is desired
- All existing functionality preserved; no API changes
2025-10-19 08:52:23 +01:00
Jeremiah Russell
724c930234 docs(eol_rule): add comprehensive documentation and examples 2025-10-19 08:52:23 +01:00
Jeremiah Russell
55b1d9a25d ♻️ refactor(eol_rule): improve labels handling
- use `cloned()` instead of `map(|i| i.to_string())` for better efficiency
2025-10-15 12:39:20 +01:00
Jeremiah Russell
0bc71f5b75 ♻️ refactor: rename Config to Rules
- rename Config struct to Rules to better reflect its purpose
- update all references to Config to Rules
2025-10-15 12:39:20 +01:00