Skip to content

Commit

Permalink
update pyo3 version and Rust edition
Browse files Browse the repository at this point in the history
  • Loading branch information
jstucke committed Aug 8, 2024
1 parent 716e07b commit 7753a3e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
12 changes: 4 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "entropython"
version = "1.1.0"
version = "1.1.1"
authors = ["Enkelmann <[email protected]>"]
edition = "2018"
edition = "2021"
description = "A Python module for efficient calculation of Shannon byte entropy based on Rust."
readme = "README.md"
homepage = "https://github.com/fkie-cad/entropython"
Expand All @@ -16,9 +16,5 @@ name = "libentropython"
path = "rust/lib.rs"
crate-type = ["cdylib"]

[dependencies.pyo3]
version = "0.17.1"

[features]
extension-module = ["pyo3/extension-module"]
default = ["extension-module"]
[dependencies]
pyo3 = { version = "0.22.2", features = ["extension-module"] }
4 changes: 2 additions & 2 deletions rust/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fn metric_entropy(bytes: &[u8]) -> f64 {
/// This module implements functions to compute the Shannon byte entropy of a byte array.
/// The computation itself is implemented in Rust for faster runtime.
#[pymodule]
fn libentropython(_py: Python, m: &PyModule) -> PyResult<()> {
fn libentropython(m: &Bound<'_, PyModule>) -> PyResult<()> {
m.add_function(wrap_pyfunction!(shannon_entropy, m)?)?;
m.add_function(wrap_pyfunction!(metric_entropy, m)?)?;
Ok(())
Expand All @@ -60,4 +60,4 @@ mod tests {
assert!(shannon_entropy(&bytes) > 7.99f64);
assert!(shannon_entropy(&bytes) <= 8f64);
}
}
}

0 comments on commit 7753a3e

Please sign in to comment.