Clippy lint

This commit is contained in:
2024-11-13 18:27:25 +00:00
parent 7d9b72327f
commit 99ff6c19bd
2 changed files with 5 additions and 6 deletions

View File

@@ -42,10 +42,10 @@ where
}
#[pyfunction]
fn read_selected_layers<'py>(
_py: Python<'py>,
fn read_selected_layers(
_py: Python<'_>,
file_list: Vec<String>,
) -> PyResult<Bound<'py, PyArray2<f64>>> {
) -> PyResult<Bound<'_, PyArray2<f64>>> {
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<Bound<'py, PyArray2<f64>>> {
fn read_layer(_py: Python<'_>, file: String) -> PyResult<Bound<'_, PyArray2<f64>>> {
let rs_result = rust_fn::read_layer(&file)?;
let py_result = rs_result.to_pyarray_bound(_py);
Ok(py_result)

View File

@@ -177,12 +177,11 @@ pub fn read_file(filepath: PathBuf) -> Result<(Array2<f64>, f64, usize)> {
.from_reader(file);
let data = rdr
.records()
.into_iter()
.collect::<std::result::Result<Vec<csv::StringRecord>, _>>()?
.iter()
.map(|x| {
x.iter()
.map(|y| y.parse::<i64>().map_err(|e| ReadError::ParseIntError(e)))
.map(|y| y.parse::<i64>().map_err(ReadError::ParseIntError))
.collect::<Result<Vec<i64>>>()
})
.collect::<Result<Vec<_>>>()?;