diff options
| author | 2025-03-15 16:29:12 +0800 | |
|---|---|---|
| committer | 2025-03-15 16:29:12 +0800 | |
| commit | 06caca8b9a9a1df9932c2c82e4ddba80d49edc5c (patch) | |
| tree | 65d8b00475678e0205801247c32b3c5620b27142 /src | |
| parent | de9e8a0c7388bc04acb951a2a687c73adb38e7ff (diff) | |
| download | conventional_role_play-06caca8b9a9a1df9932c2c82e4ddba80d49edc5c.tar.gz conventional_role_play-06caca8b9a9a1df9932c2c82e4ddba80d49edc5c.zip | |
bump: update pyo3 dependency to version 0.24.0 and improve module function signature
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib.rs | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -8,8 +8,11 @@ fn sum_as_string(a: usize, b: usize) -> PyResult<String> { #[pyclass] pub struct Base {} +/// A Python module implemented in Rust. The name of this function must match +/// the `lib.name` setting in the `Cargo.toml`, else Python will not be able to +/// import the module. #[pymodule] -fn _core(_py: Python<'_>, m: &PyModule) -> PyResult<()> { +fn _core(m: &Bound<'_, PyModule>) -> PyResult<()> { m.add_function(wrap_pyfunction!(sum_as_string, m)?)?; m.add_class::<Base>()?; Ok(()) |
