From 4c55fa6b381d840fed6ca168fc7c4cebfbd1b266 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Niederb=C3=BChl?= Date: Fri, 5 Jun 2020 14:36:14 +0200 Subject: [PATCH] Remove unnecessary wrapping of test function --- examples/word-count/src/lib.rs | 2 -- examples/word-count/word_count/__init__.py | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/examples/word-count/src/lib.rs b/examples/word-count/src/lib.rs index e5f7f84c..d79e6b50 100644 --- a/examples/word-count/src/lib.rs +++ b/examples/word-count/src/lib.rs @@ -42,7 +42,6 @@ fn matches(word: &str, needle: &str) -> bool { } /// Count the occurences of needle in line, case insensitive -#[pyfunction] fn count_line(line: &str, needle: &str) -> usize { let mut total = 0; for word in line.split(' ') { @@ -55,7 +54,6 @@ fn count_line(line: &str, needle: &str) -> usize { #[pymodule] fn word_count(_py: Python<'_>, m: &PyModule) -> PyResult<()> { - m.add_wrapped(wrap_pyfunction!(count_line))?; m.add_wrapped(wrap_pyfunction!(search))?; m.add_wrapped(wrap_pyfunction!(search_sequential))?; diff --git a/examples/word-count/word_count/__init__.py b/examples/word-count/word_count/__init__.py index 8e23177d..5b585575 100644 --- a/examples/word-count/word_count/__init__.py +++ b/examples/word-count/word_count/__init__.py @@ -1,6 +1,6 @@ -from .word_count import count_line, search, search_sequential +from .word_count import search, search_sequential -__all__ = ["count_line", "search_py", "search", "search_sequential"] +__all__ = ["search_py", "search", "search_sequential"] def search_py(contents, needle):