Remove unnecessary wrapping of test function

This commit is contained in:
Alexander Niederbühl 2020-06-05 14:36:14 +02:00
parent eb73105625
commit 4c55fa6b38
2 changed files with 2 additions and 4 deletions

View File

@ -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))?;

View File

@ -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):