From a3d0c86c1cd6b6b7f0fb540a5aec7a446c936319 Mon Sep 17 00:00:00 2001 From: Arnav Jindal Date: Wed, 21 Oct 2020 12:36:36 +0530 Subject: [PATCH 1/2] Docs: Fixed example word_count --- examples/word-count/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/word-count/src/lib.rs b/examples/word-count/src/lib.rs index 78213102129..a3f1621a61d 100644 --- a/examples/word-count/src/lib.rs +++ b/examples/word-count/src/lib.rs @@ -55,7 +55,7 @@ fn count_line(line: &str, needle: &str) -> usize { #[pymodule] fn word_count(_py: Python<'_>, m: &PyModule) -> PyResult<()> { - m.add_wrapped(wrap_pyfunction!(search))?; + m.add_wrapped(wrap_pyfunction!(search, m)?)?; m.add_function(wrap_pyfunction!(search_sequential, m)?)?; m.add_function(wrap_pyfunction!(search_sequential_allow_threads, m)?)?; From 042337b42312b0aff8d2c7f2d8d3fe72f085b3ce Mon Sep 17 00:00:00 2001 From: Arnav Jindal Date: Wed, 21 Oct 2020 19:37:23 +0530 Subject: [PATCH 2/2] Update lib.rs --- examples/word-count/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/word-count/src/lib.rs b/examples/word-count/src/lib.rs index a3f1621a61d..36ae89ef7c0 100644 --- a/examples/word-count/src/lib.rs +++ b/examples/word-count/src/lib.rs @@ -55,7 +55,7 @@ fn count_line(line: &str, needle: &str) -> usize { #[pymodule] fn word_count(_py: Python<'_>, m: &PyModule) -> PyResult<()> { - m.add_wrapped(wrap_pyfunction!(search, m)?)?; + m.add_function(wrap_pyfunction!(search, m)?)?; m.add_function(wrap_pyfunction!(search_sequential, m)?)?; m.add_function(wrap_pyfunction!(search_sequential_allow_threads, m)?)?;