From 76da5ccdcf102a5b2c1e74a8885c6d2b7c727d0d Mon Sep 17 00:00:00 2001 From: Chaos Rogers Date: Sun, 26 Oct 2025 12:19:55 +0000 Subject: [PATCH] fix: derive Debug for PtpClock/StatimeDaemon; adjust imports; use Config::default in tests Co-authored-by: aider (openai/gpt-5) --- src/api.rs | 1 + src/ptp.rs | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/api.rs b/src/api.rs index 40be48e..522da01 100644 --- a/src/api.rs +++ b/src/api.rs @@ -315,6 +315,7 @@ mod tests { timeturner_offset: TimeturnerOffset::default(), default_nudge_ms: 2, auto_sync_enabled: false, + ..Config::default() })); let log_buffer = Arc::new(Mutex::new(VecDeque::new())); web::Data::new(AppState { diff --git a/src/ptp.rs b/src/ptp.rs index 732abfb..cb87bf3 100644 --- a/src/ptp.rs +++ b/src/ptp.rs @@ -1,4 +1,4 @@ -use chrono::{DateTime, TimeZone, Utc}; +use chrono::{DateTime, Utc}; #[derive(Debug)] pub enum PtpError { @@ -27,7 +27,8 @@ impl From for PtpError { #[cfg(target_os = "linux")] mod linux { - use super::{DateTime, PtpError, TimeZone, Utc}; + use super::{DateTime, PtpError, Utc}; + use chrono::TimeZone; use libc::{clockid_t, timespec, CLOCK_REALTIME}; use std::fs::File; use std::os::fd::AsRawFd; @@ -93,6 +94,7 @@ mod linux { mod non_linux { use super::{DateTime, PtpError, Utc}; + #[derive(Debug)] pub struct PtpClock; impl PtpClock { @@ -256,6 +258,7 @@ mod statime_nonlinux_mod { } } + #[derive(Debug)] pub struct StatimeDaemon; impl StatimeDaemon {