Mikhail Kilin
c6beea5608
refactor: create timeout/retry utilities to reduce code duplication (P1.1)
Created new utility modules to eliminate repeated timeout/retry patterns:
- src/utils/retry.rs: with_timeout() and with_timeout_msg() helpers
- src/utils/formatting.rs: timestamp formatting utilities (from utils.rs)
- src/utils/tdlib.rs: TDLib log configuration utilities (from utils.rs)
Refactored src/input/main_input.rs:
- Replaced 18+ instances of timeout(Duration, op).await pattern
- Simplified error handling from nested Ok(Ok(...))/Ok(Err(...))/Err(...)
to cleaner Ok(...)/Err(...) with custom timeout messages
- Added type annotations for compiler type inference
Benefits:
- Reduced code duplication from ~20 instances to 2 utility functions
- Cleaner, more readable error handling
- Easier to maintain timeout logic in one place
- All 59 tests passing
Progress: REFACTORING_OPPORTUNITIES.md #1 (Дублирование кода) - Частично выполнено
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-01 19:56:33 +03:00
..
2026-02-01 18:57:55 +03:00
2026-02-01 19:56:33 +03:00
2026-02-01 18:57:55 +03:00
2026-02-01 18:57:55 +03:00
2026-02-01 19:56:33 +03:00
2026-02-01 02:29:08 +03:00
2026-02-01 18:57:55 +03:00
2026-02-01 01:03:30 +03:00
2026-02-01 18:57:55 +03:00
2026-02-01 18:57:55 +03:00
2026-01-31 23:30:41 +03:00
2026-01-31 03:48:50 +03:00