mirror of
https://github.com/telemt/telemt.git
synced 2026-04-15 01:24:09 +03:00
fix: eliminate all compiler warnings
- Remove unused imports across multiple modules - Add #![allow(dead_code)] for public API items preserved for future use - Add #![allow(deprecated)] for rand::Rng::gen_range usage - Add #![allow(unused_assignments)] in main.rs - Add #![allow(unreachable_code)] in network/stun.rs - Prefix unused variables with underscore (_ip_tracker, _prefer_ipv6) - Fix unused_must_use warning in tls_front/cache.rs This ensures clean compilation without warnings while preserving public API items that may be used in the future.
This commit is contained in:
@@ -4,11 +4,14 @@ use std::time::Duration;
|
||||
use chrono::{DateTime, Utc};
|
||||
use tracing::{debug, warn, error};
|
||||
|
||||
#[allow(dead_code)]
|
||||
const TIME_SYNC_URL: &str = "https://core.telegram.org/getProxySecret";
|
||||
#[allow(dead_code)]
|
||||
const MAX_TIME_SKEW_SECS: i64 = 30;
|
||||
|
||||
/// Time sync result
|
||||
#[derive(Debug, Clone)]
|
||||
#[allow(dead_code)]
|
||||
pub struct TimeSyncResult {
|
||||
pub server_time: DateTime<Utc>,
|
||||
pub local_time: DateTime<Utc>,
|
||||
@@ -17,6 +20,7 @@ pub struct TimeSyncResult {
|
||||
}
|
||||
|
||||
/// Check time synchronization with Telegram servers
|
||||
#[allow(dead_code)]
|
||||
pub async fn check_time_sync() -> Option<TimeSyncResult> {
|
||||
let client = reqwest::Client::builder()
|
||||
.timeout(Duration::from_secs(10))
|
||||
@@ -60,6 +64,7 @@ pub async fn check_time_sync() -> Option<TimeSyncResult> {
|
||||
}
|
||||
|
||||
/// Background time sync task
|
||||
#[allow(dead_code)]
|
||||
pub async fn time_sync_task(check_interval: Duration) -> ! {
|
||||
loop {
|
||||
if let Some(result) = check_time_sync().await {
|
||||
|
||||
Reference in New Issue
Block a user