Remove unnecessary wrapping of test function
This commit is contained in:
parent
eb73105625
commit
4c55fa6b38
|
@ -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))?;
|
||||
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue