From d7e7c89d0b03930813eb2879e34f538c195f3d1c Mon Sep 17 00:00:00 2001 From: Lasse Nielsen Date: Fri, 12 Jul 2024 11:30:34 +0200 Subject: [PATCH] Fixes --- Cargo.toml | 4 ++-- src/lib.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 6d641b5..a9a944a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" license = "GPL-3.0-only" authors = ["Lasse Nielsen "] readme = "README.md" -documentation = "https://docs.rs/shr_parser" +documentation = "https://docs.rs/shr_parser_py" repository = "https://github.com/Xerrion/shr_parser_py" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -15,5 +15,5 @@ crate-type = ["cdylib"] name = "shr_parser" [dependencies] -pyo3 = "0.22.1" +pyo3 = { version = "0.22.1", features = ["extension-module"] } shr_parser = "1.0.5" diff --git a/src/lib.rs b/src/lib.rs index f909509..1b62868 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -54,8 +54,8 @@ fn create_parser(file_path: String, parsing_type: i32) -> PyResult /// A Python module implemented in Rust. #[pymodule] -fn shr_parser_py(_py: Python, m: &PyModule) -> PyResult<()> { - m.add_class::()?; - m.add_function(wrap_pyfunction!(create_parser, m)?)?; + fn my_module(module: &Bound<'_, PyModule>) -> PyResult<()> { + module.add_class::()?; + module.add_function(wrap_pyfunction!(create_parser, module)?)?; Ok(()) }