refactor: complete large files/functions refactoring (Phase 6-7)
Phase 6: Refactor tdlib/client.rs ✅ - Extract update handlers to update_handlers.rs (302 lines, 8 functions) - Extract message converter to message_converter.rs (250 lines, 6 functions) - Extract chat helpers to chat_helpers.rs (149 lines, 3 functions) - Result: client.rs 1259 → 599 lines (-52%) Phase 7: Refactor tdlib/messages.rs ✅ - Create message_conversion.rs module (158 lines) - Extract 6 helper functions: - extract_content_text() - content extraction (~80 lines) - extract_entities() - formatting extraction (~10 lines) - extract_sender_name() - sender name with API call (~15 lines) - extract_forward_info() - forward info (~12 lines) - extract_reply_info() - reply info (~15 lines) - extract_reactions() - reactions extraction (~26 lines) - Result: convert_message() 150 → 57 lines (-62%) - Result: messages.rs 850 → 757 lines (-11%) Summary: - ✅ All 4 large files refactored (100%) - ✅ All 629 tests passing - ✅ Category #2 "Large files/functions" COMPLETE - ✅ Documentation updated (REFACTORING_OPPORTUNITIES.md, CONTEXT.md) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,12 +1,16 @@
|
||||
// Модули
|
||||
pub mod auth;
|
||||
mod chat_helpers; // Chat management helpers
|
||||
pub mod chats;
|
||||
pub mod client;
|
||||
mod client_impl; // Private module for trait implementation
|
||||
mod message_converter; // Message conversion utilities (for client.rs)
|
||||
mod message_conversion; // Message conversion utilities (for messages.rs)
|
||||
pub mod messages;
|
||||
pub mod reactions;
|
||||
pub mod r#trait;
|
||||
pub mod types;
|
||||
mod update_handlers; // Update handlers extracted from client
|
||||
pub mod users;
|
||||
|
||||
// Экспорт основных типов
|
||||
|
||||
Reference in New Issue
Block a user