From 10f4fddda0c89f19d03f8d75499a19e4caae8515 Mon Sep 17 00:00:00 2001 From: Simon Gerber Date: Thu, 14 Sep 2023 10:40:47 +0200 Subject: [PATCH] Introduce a pure Rust `Reclass::render_inventory()` --- src/lib.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index f5718ae..98b5fc8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -172,6 +172,10 @@ impl Reclass { n.render(self)?; Ok(NodeInfo::from(n)) } + + pub fn render_inventory(&self) -> Result { + Inventory::render(self) + } } #[pymethods] @@ -200,7 +204,7 @@ impl Reclass { /// Returns the rendered data for the full inventory. pub fn inventory(&self) -> PyResult { - Inventory::render(self) + self.render_inventory() .map_err(|e| PyValueError::new_err(format!("Error while rendering inventory: {e}"))) }