fix: resolve all 40 clippy warnings (dead_code, unused_imports, lints)
Some checks failed
ci/woodpecker/pr/check Pipeline was successful
CI / Check (pull_request) Has been cancelled
CI / Format (pull_request) Has been cancelled
CI / Clippy (pull_request) Has been cancelled
CI / Build (macos-latest) (pull_request) Has been cancelled
CI / Build (ubuntu-latest) (pull_request) Has been cancelled
CI / Build (windows-latest) (pull_request) Has been cancelled

- Add #[allow(unused_imports)] on pub re-exports used only by lib/tests
- Add #[allow(dead_code)] on public API items unused in binary target
- Fix collapsible_if, redundant_closure, unnecessary_map_or in main.rs
- Prefix unused test variables with underscore

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Mikhail Kilin
2026-02-22 17:50:18 +03:00
parent 166fda93a4
commit 3b7ef41cae
25 changed files with 66 additions and 9 deletions

View File

@@ -10,6 +10,7 @@ use tele_tui::tdlib::{ChatInfo, MessageInfo};
use tele_tui::types::{ChatId, MessageId};
/// Builder для создания тестового App с FakeTdClient\n///\n/// Использует trait-based DI для подмены TdClient на FakeTdClient в тестах.
#[allow(dead_code)]
pub struct TestAppBuilder {
config: Config,
screen: AppScreen,
@@ -34,6 +35,7 @@ impl Default for TestAppBuilder {
}
}
#[allow(dead_code)]
impl TestAppBuilder {
pub fn new() -> Self {
Self {

View File

@@ -9,6 +9,7 @@ use tokio::sync::mpsc;
/// Update события от TDLib (упрощённая версия)
#[derive(Debug, Clone)]
#[allow(dead_code)]
pub enum TdUpdate {
NewMessage {
chat_id: ChatId,
@@ -47,6 +48,7 @@ pub enum TdUpdate {
}
/// Упрощённый mock TDLib клиента для тестов
#[allow(dead_code)]
pub struct FakeTdClient {
// Данные
pub chats: Arc<Mutex<Vec<ChatInfo>>>,
@@ -86,6 +88,7 @@ pub struct FakeTdClient {
}
#[derive(Debug, Clone)]
#[allow(dead_code)]
pub struct SentMessage {
pub chat_id: i64,
pub text: String,
@@ -94,6 +97,7 @@ pub struct SentMessage {
}
#[derive(Debug, Clone)]
#[allow(dead_code)]
pub struct EditedMessage {
pub chat_id: i64,
pub message_id: MessageId,
@@ -101,6 +105,7 @@ pub struct EditedMessage {
}
#[derive(Debug, Clone)]
#[allow(dead_code)]
pub struct DeletedMessages {
pub chat_id: i64,
pub message_ids: Vec<MessageId>,
@@ -108,6 +113,7 @@ pub struct DeletedMessages {
}
#[derive(Debug, Clone)]
#[allow(dead_code)]
pub struct ForwardedMessages {
pub from_chat_id: i64,
pub to_chat_id: i64,
@@ -115,6 +121,7 @@ pub struct ForwardedMessages {
}
#[derive(Debug, Clone)]
#[allow(dead_code)]
pub struct SearchQuery {
pub chat_id: i64,
pub query: String,
@@ -158,6 +165,7 @@ impl Clone for FakeTdClient {
}
}
#[allow(dead_code)]
impl FakeTdClient {
pub fn new() -> Self {
Self {

View File

@@ -5,6 +5,7 @@ use tele_tui::tdlib::{ChatInfo, MessageInfo, ProfileInfo, ReplyInfo};
use tele_tui::types::{ChatId, MessageId};
/// Builder для создания тестового чата
#[allow(dead_code)]
pub struct TestChatBuilder {
id: i64,
title: String,
@@ -21,6 +22,7 @@ pub struct TestChatBuilder {
draft_text: Option<String>,
}
#[allow(dead_code)]
impl TestChatBuilder {
pub fn new(title: &str, id: i64) -> Self {
Self {
@@ -100,6 +102,7 @@ impl TestChatBuilder {
}
/// Builder для создания тестового сообщения
#[allow(dead_code)]
pub struct TestMessageBuilder {
id: i64,
sender_name: String,
@@ -118,6 +121,7 @@ pub struct TestMessageBuilder {
media_album_id: i64,
}
#[allow(dead_code)]
impl TestMessageBuilder {
pub fn new(content: &str, id: i64) -> Self {
Self {