Skip to content

Commit

Permalink
Introduce a pure Rust Reclass::render_inventory()
Browse files Browse the repository at this point in the history
  • Loading branch information
simu committed Sep 19, 2023
1 parent c18b027 commit 10f4fdd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ impl Reclass {
n.render(self)?;
Ok(NodeInfo::from(n))
}

pub fn render_inventory(&self) -> Result<Inventory> {
Inventory::render(self)
}
}

#[pymethods]
Expand Down Expand Up @@ -200,7 +204,7 @@ impl Reclass {

/// Returns the rendered data for the full inventory.
pub fn inventory(&self) -> PyResult<Inventory> {
Inventory::render(self)
self.render_inventory()
.map_err(|e| PyValueError::new_err(format!("Error while rendering inventory: {e}")))
}

Expand Down

0 comments on commit 10f4fdd

Please sign in to comment.