mirror of
https://github.com/Cian-H/read_aconity_layers.git
synced 2025-12-22 18:31:56 +00:00
Clippy lint
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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<_>>>()?;
|
||||
|
||||
Reference in New Issue
Block a user