chore: remove dead code and unnecessary allow(dead_code) attributes
Cleaned up warnings by removing unused code: - Removed unused format_timestamp() function from utils.rs - Removed unused len() method from LruCache - Removed unused date field from ForwardInfo struct - Removed unnecessary #[allow(dead_code)] attributes from: * AuthState enum (actually used) * ChatInfo struct (actually used) * TdClient impl block (actually used) This reduces code noise and makes real warnings more visible. Changes: - 20 lines removed - 1 line added - 6 files changed Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -6,7 +6,6 @@ use tdlib_rs::functions;
|
||||
/// Отслеживает текущий этап аутентификации пользователя,
|
||||
/// от инициализации TDLib до полной авторизации.
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[allow(dead_code)]
|
||||
pub enum AuthState {
|
||||
/// Ожидание параметров TDLib (начальное состояние).
|
||||
WaitTdlibParameters,
|
||||
|
||||
@@ -59,7 +59,6 @@ pub struct TdClient {
|
||||
pub network_state: NetworkState,
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
impl TdClient {
|
||||
/// Creates a new TDLib client instance.
|
||||
///
|
||||
@@ -1102,7 +1101,7 @@ impl TdClient {
|
||||
fn extract_forward_info(&self, message: &TdMessage) -> Option<ForwardInfo> {
|
||||
message.forward_info.as_ref().map(|info| {
|
||||
let sender_name = self.get_origin_sender_name(&info.origin);
|
||||
ForwardInfo { sender_name, date: info.date }
|
||||
ForwardInfo { sender_name }
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -720,7 +720,6 @@ impl MessageManager {
|
||||
if let tdlib_rs::enums::MessageOrigin::User(origin_user) = &fi.origin {
|
||||
Some(ForwardInfo {
|
||||
sender_name: format!("User {}", origin_user.sender_user_id),
|
||||
date: fi.date,
|
||||
})
|
||||
} else {
|
||||
None
|
||||
|
||||
@@ -3,7 +3,6 @@ use tdlib_rs::types::TextEntity;
|
||||
use crate::types::{ChatId, MessageId};
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
#[allow(dead_code)]
|
||||
pub struct ChatInfo {
|
||||
pub id: ChatId,
|
||||
pub title: String,
|
||||
@@ -41,9 +40,6 @@ pub struct ReplyInfo {
|
||||
pub struct ForwardInfo {
|
||||
/// Имя оригинального отправителя
|
||||
pub sender_name: String,
|
||||
/// Дата оригинального сообщения (для будущего использования)
|
||||
#[allow(dead_code)]
|
||||
pub date: i32,
|
||||
}
|
||||
|
||||
/// Информация о реакции на сообщение
|
||||
|
||||
@@ -89,12 +89,6 @@ where
|
||||
pub fn contains_key(&self, key: &K) -> bool {
|
||||
self.map.contains_key(key)
|
||||
}
|
||||
|
||||
/// Количество элементов
|
||||
#[allow(dead_code)]
|
||||
pub fn len(&self) -> usize {
|
||||
self.map.len()
|
||||
}
|
||||
}
|
||||
|
||||
/// Кэш информации о пользователях Telegram.
|
||||
|
||||
Reference in New Issue
Block a user