mirror of
https://github.com/Cian-H/read_aconity_layers.git
synced 2025-12-23 02:31:57 +00:00
Clippy lint
This commit is contained in:
@@ -42,10 +42,10 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[pyfunction]
|
#[pyfunction]
|
||||||
fn read_selected_layers<'py>(
|
fn read_selected_layers(
|
||||||
_py: Python<'py>,
|
_py: Python<'_>,
|
||||||
file_list: Vec<String>,
|
file_list: Vec<String>,
|
||||||
) -> PyResult<Bound<'py, PyArray2<f64>>> {
|
) -> PyResult<Bound<'_, PyArray2<f64>>> {
|
||||||
let path_list = file_list
|
let path_list = file_list
|
||||||
.iter()
|
.iter()
|
||||||
.map(|x| Path::new(x).to_path_buf())
|
.map(|x| Path::new(x).to_path_buf())
|
||||||
@@ -56,7 +56,7 @@ fn read_selected_layers<'py>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[pyfunction]
|
#[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 rs_result = rust_fn::read_layer(&file)?;
|
||||||
let py_result = rs_result.to_pyarray_bound(_py);
|
let py_result = rs_result.to_pyarray_bound(_py);
|
||||||
Ok(py_result)
|
Ok(py_result)
|
||||||
|
|||||||
@@ -177,12 +177,11 @@ pub fn read_file(filepath: PathBuf) -> Result<(Array2<f64>, f64, usize)> {
|
|||||||
.from_reader(file);
|
.from_reader(file);
|
||||||
let data = rdr
|
let data = rdr
|
||||||
.records()
|
.records()
|
||||||
.into_iter()
|
|
||||||
.collect::<std::result::Result<Vec<csv::StringRecord>, _>>()?
|
.collect::<std::result::Result<Vec<csv::StringRecord>, _>>()?
|
||||||
.iter()
|
.iter()
|
||||||
.map(|x| {
|
.map(|x| {
|
||||||
x.iter()
|
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<i64>>>()
|
||||||
})
|
})
|
||||||
.collect::<Result<Vec<_>>>()?;
|
.collect::<Result<Vec<_>>>()?;
|
||||||
|
|||||||
Reference in New Issue
Block a user