From 99ff6c19bdbd15e2aabb46d68a9d32162003dfae Mon Sep 17 00:00:00 2001 From: Cian Hughes Date: Wed, 13 Nov 2024 18:27:25 +0000 Subject: [PATCH] Clippy lint --- src/lib.rs | 8 ++++---- src/rust_fn/mod.rs | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index f471887..fef8301 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -42,10 +42,10 @@ where } #[pyfunction] -fn read_selected_layers<'py>( - _py: Python<'py>, +fn read_selected_layers( + _py: Python<'_>, file_list: Vec, -) -> PyResult>> { +) -> PyResult>> { let path_list = file_list .iter() .map(|x| Path::new(x).to_path_buf()) @@ -56,7 +56,7 @@ fn read_selected_layers<'py>( } #[pyfunction] -fn read_layer<'py>(_py: Python<'py>, file: String) -> PyResult>> { +fn read_layer(_py: Python<'_>, file: String) -> PyResult>> { let rs_result = rust_fn::read_layer(&file)?; let py_result = rs_result.to_pyarray_bound(_py); Ok(py_result) diff --git a/src/rust_fn/mod.rs b/src/rust_fn/mod.rs index 646e40e..8cb36e2 100644 --- a/src/rust_fn/mod.rs +++ b/src/rust_fn/mod.rs @@ -177,12 +177,11 @@ pub fn read_file(filepath: PathBuf) -> Result<(Array2, f64, usize)> { .from_reader(file); let data = rdr .records() - .into_iter() .collect::, _>>()? .iter() .map(|x| { x.iter() - .map(|y| y.parse::().map_err(|e| ReadError::ParseIntError(e))) + .map(|y| y.parse::().map_err(ReadError::ParseIntError)) .collect::>>() }) .collect::>>()?;