From 20c6bbcbf73bb72047aa5385689d5755c70a5de4 Mon Sep 17 00:00:00 2001 From: "Victor M. Alvarez" Date: Wed, 16 Aug 2023 11:33:09 +0200 Subject: [PATCH] feat(py): add `warnings` method to `Rules` object --- yara-x-py/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/yara-x-py/src/lib.rs b/yara-x-py/src/lib.rs index a2508dbca..c047cbd56 100644 --- a/yara-x-py/src/lib.rs +++ b/yara-x-py/src/lib.rs @@ -269,6 +269,10 @@ impl Rules { .serialize_into(f) .map_err(|err| PyIOError::new_err(err.to_string())) } + + fn warnings(&self) -> Vec { + self.inner.rules.warnings().iter().map(|w| w.to_string()).collect() + } } /// Python module for compiling YARA rules and scanning data with them.