Skip to content

Commit

Permalink
address clippy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelkirk committed Sep 18, 2024
1 parent 9ab5682 commit 0c3c639
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions geozero/src/csv/csv_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,10 @@ pub fn process_csv_geom(
processor.geometrycollection_begin(1, 0)?;
}

crate::wkt::wkt_reader::process_wkt_geom_n(&wkt, record_idx, processor).map_err(|e| {
crate::wkt::wkt_reader::process_wkt_geom_n(&wkt, record_idx, processor).inspect_err(|_e| {
// +2 to start at line 1 and to account for the header row
let line = record_idx + 2;
log::warn!("line {line}: invalid WKT: '{geometry_field}', record: {record:?}");
e
})?;
}

Expand Down Expand Up @@ -186,12 +185,11 @@ pub fn process_csv_features(
// Do all formats allow empty geometries?
if !geometry_field.is_empty() {
processor.geometry_begin()?;
crate::wkt::wkt_reader::read_wkt(&mut geometry_field.as_bytes(), processor).map_err(
|e| {
crate::wkt::wkt_reader::read_wkt(&mut geometry_field.as_bytes(), processor).inspect_err(
|_e| {
// +2 to start at line 1 and to account for the header row
let line = feature_idx + 2;
log::warn!("line {line}: invalid WKT: '{geometry_field}', record: {record:?}");
e
},
)?;
processor.geometry_end()?;
Expand Down

0 comments on commit 0c3c639

Please sign in to comment.