From d300ef9834350b1e1d2b8775f3fe7a40c2c3b398 Mon Sep 17 00:00:00 2001 From: David Venhoek Date: Thu, 21 Sep 2023 09:59:22 +0200 Subject: [PATCH] Exposed steering state. --- statime-linux/src/main.rs | 1 - statime/src/port/mod.rs | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/statime-linux/src/main.rs b/statime-linux/src/main.rs index fded1255f..1eb3a7323 100644 --- a/statime-linux/src/main.rs +++ b/statime-linux/src/main.rs @@ -3,7 +3,6 @@ use std::{ path::PathBuf, pin::{pin, Pin}, str::FromStr, - sync::OnceLock, }; use clap::Parser; diff --git a/statime/src/port/mod.rs b/statime/src/port/mod.rs index 552e41abd..fc23fc8f8 100644 --- a/statime/src/port/mod.rs +++ b/statime/src/port/mod.rs @@ -350,6 +350,10 @@ impl Port { } impl Port { + pub fn is_steering(&self) -> bool { + matches!(self.port_state, PortState::Slave(_)) + } + pub(crate) fn state(&self) -> &PortState { &self.port_state }