From 66a3c2409cf552f09388d56e75cdba1c93f5f768 Mon Sep 17 00:00:00 2001 From: damocles Date: Mon, 10 Aug 2026 16:19:40 +0200 Subject: [PATCH] rename JournalPriority::as_str to as_journald_str --- hive-c0re/src/socket_server/mod.rs | 4 ++-- hive-sh4re/src/lib.rs | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/hive-c0re/src/socket_server/mod.rs b/hive-c0re/src/socket_server/mod.rs index c2f65173..d2c9f2e8 100644 --- a/hive-c0re/src/socket_server/mod.rs +++ b/hive-c0re/src/socket_server/mod.rs @@ -859,7 +859,7 @@ pub async fn dispatch_host_journal(agent: &str, args: HostJournalArgs<'_>) -> Re hive_priv_sock::JournalQuery { lines: n, unit: unit.clone(), - priority: priority.as_ref().map(|p| p.as_str().to_owned()), + priority: priority.as_ref().map(|p| p.as_journald_str().to_owned()), grep: grep.clone(), since: since.clone(), until: until.clone(), @@ -890,7 +890,7 @@ pub async fn dispatch_host_journal(agent: &str, args: HostJournalArgs<'_>) -> Re } if let Some(p) = priority { args.push("-p".to_owned()); - args.push(p.as_str().to_owned()); + args.push(p.as_journald_str().to_owned()); } if let Some(g) = grep { args.push(format!("--grep={g}")); diff --git a/hive-sh4re/src/lib.rs b/hive-sh4re/src/lib.rs index 468b0f47..ac6370e2 100644 --- a/hive-sh4re/src/lib.rs +++ b/hive-sh4re/src/lib.rs @@ -774,9 +774,13 @@ pub enum JournalPriority { } impl JournalPriority { - /// Returns the lowercase string journalctl expects for `-p`. + /// Returns the lowercase string journalctl expects for `-p`. Named + /// `as_journald_str` (not `as_str`) because this is a specific + /// external-tool encoding, not the enum's general wire/db string — + /// distinct call sites shouldn't reach for this by accident when they + /// actually want the serde wire representation. #[must_use] - pub fn as_str(self) -> &'static str { + pub fn as_journald_str(self) -> &'static str { match self { Self::Emerg => "emerg", Self::Alert => "alert",