From d05f03fc1ea7bc4a6c837e7d8116064e37ded411 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Thu, 9 Oct 2025 08:13:30 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(config):=20add=20get=5Frule=20?= =?UTF-8?q?function=20to=20retrieve=20existing=20rules?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - implement get_rule function to fetch rule by id --- src/config.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/config.rs b/src/config.rs index 0f76fde..ae6410d 100644 --- a/src/config.rs +++ b/src/config.rs @@ -50,6 +50,11 @@ impl Config { self } + /// Get the contents of an existing rule + pub fn get_rule(&self, id: usize) -> Option { + self.rules.get(&id.to_string()).cloned() + } + /// Add a new rule to the rule set by setting the retention age pub fn add_rule( &mut self,