mirror of
https://github.com/telemt/telemt.git
synced 2026-04-15 01:24:09 +03:00
fix: resolve clippy warnings
Reduce clippy warnings from54 to16 by fixing mechanical issues: - collapsible_if: collapse nested if-let chains with let-chains - clone_on_copy: remove unnecessary .clone() on Copy types - manual_clamp: replace .max().min() with .clamp() - unnecessary_cast: remove redundant type casts - collapsible_else_if: flatten else-if chains - contains_vs_iter_any: replace .iter().any() with .contains() - unnecessary_closure: replace .or_else(|| x) with .or(x) - useless_conversion: remove redundant .into() calls - is_none_or: replace .map_or(true, ...) with .is_none_or(...) - while_let_loop: convert loop with if-let-break to while-let Remaining16 warnings are design-level issues (too_many_arguments, await_holding_lock, type_complexity, new_ret_no_self) that require architectural changes to fix.
This commit is contained in:
@@ -67,15 +67,15 @@ pub async fn check_time_sync() -> Option<TimeSyncResult> {
|
||||
#[allow(dead_code)]
|
||||
pub async fn time_sync_task(check_interval: Duration) -> ! {
|
||||
loop {
|
||||
if let Some(result) = check_time_sync().await {
|
||||
if result.is_skewed {
|
||||
error!(
|
||||
"System clock is off by {} seconds. Please sync your clock.",
|
||||
result.skew_secs
|
||||
);
|
||||
}
|
||||
if let Some(result) = check_time_sync().await
|
||||
&& result.is_skewed
|
||||
{
|
||||
error!(
|
||||
"System clock is off by {} seconds. Please sync your clock.",
|
||||
result.skew_secs
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
tokio::time::sleep(check_interval).await;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user