diff options
Diffstat (limited to 'crates/turtle/src/client')
| -rw-r--r-- | crates/turtle/src/client/mod.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/crates/turtle/src/client/mod.rs b/crates/turtle/src/client/mod.rs index 07f01e6c..ec97c994 100644 --- a/crates/turtle/src/client/mod.rs +++ b/crates/turtle/src/client/mod.rs @@ -54,12 +54,12 @@ pub fn history_entry_to_history(entry: HistoryEntry) -> History { } #[must_use] -pub fn daemon_matches_expected(version: &str, protocol: u32) -> bool { +pub fn daemon_matches_expected(protocol: u32) -> bool { protocol == DAEMON_PROTOCOL_VERSION } #[must_use] -pub fn daemon_mismatch_message(version: &str, protocol: u32) -> String { +pub fn daemon_mismatch_message(protocol: u32) -> String { if protocol == DAEMON_PROTOCOL_VERSION { unreachable!() } else { @@ -110,10 +110,10 @@ pub async fn probe(path: String) -> Probe { match client.status().await { Ok(status) => { - if daemon_matches_expected(&status.version, status.protocol) { + if daemon_matches_expected(status.protocol) { Probe::Ready(client) } else { - Probe::NeedsRestart(daemon_mismatch_message(&status.version, status.protocol)) + Probe::NeedsRestart(daemon_mismatch_message(status.protocol)) } } Err(err) => Probe::Unreachable(err), @@ -129,6 +129,7 @@ pub struct HistoryClient { client: HistoryServiceClient<Channel>, } +#[derive(Clone, Copy, Debug)] pub struct Range { pub start: OffsetDateTime, pub end: OffsetDateTime, |
