Skip to content

Commit

Permalink
Update lib.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
baseplate-admin authored May 14, 2024
1 parent 4db57cb commit 5dcf6b1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/rust/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,15 +350,14 @@ fn svg_to_bytes(
Ok(pixmap)
}

#[pyfunction]
#[pyo3(name = "version")]
fn get_version() -> &'static str {
static VERSION : std::sync::OnceLock<String> = std::sync::OnceLock::new();

VERSION.get_or_init(||{
env!("CARGO_PKG_VERSION").to_owned()
})
}

/// A Python module implemented in Rust.
#[pymodule]
fn resvg_py(_py: Python, m: &Bound<'_, PyModule>) -> PyResult<()> {
Expand Down

0 comments on commit 5dcf6b1

Please sign in to comment.