Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion geoengine/operators/src/source/gdal_source/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ mod tests {
CacheHint::default(),
)
})
.map_err(Into::into)
}

fn tile_information_with_partition_and_shape(
Expand Down
23 changes: 13 additions & 10 deletions geoengine/operators/src/source/gdal_worker_process/process_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ mod tests {

let (sender, receiver) = ipc_channel::ipc::channel().unwrap();

sender.send(msg.clone()).unwrap();
sender.send(msg).unwrap();
let recv = receiver.recv().unwrap();
assert_eq!(msg, recv);
}
Expand All @@ -797,7 +797,7 @@ mod tests {

let (sender, receiver) = ipc_channel::ipc::channel().unwrap();

sender.send(msg.clone()).unwrap();
sender.send(msg).unwrap();
let recv = receiver.recv().unwrap();
assert_eq!(msg, recv);
}
Expand Down Expand Up @@ -941,12 +941,12 @@ mod tests {
sender.send(msg).unwrap();
let rx_result = receiver
.recv()
.inspect_err(|e| panic!("IPC receive: {:?}", e))
.inspect_err(|e| panic!("IPC receive: {e:?}"))
.unwrap();

let payload = match rx_result {
Ok(r) => r,
Err(e) => panic!("Error receiving from IPC process: {:?}", e),
Err(e) => panic!("Error receiving from IPC process: {e:?}"),
};

let result_2: GdalIpcPayload<u8> = (&payload).try_into().unwrap();
Expand Down Expand Up @@ -1003,8 +1003,7 @@ mod tests {
let dataset = gdc.get_or_open(&dataset_params).unwrap();

let reader_payload =
GdalHandling::load_tile_data::<u8>(dataset, &dataset_params, gdal_read_advice)
.map_err(IpcProcessError::from)?;
GdalHandling::load_tile_data::<u8>(dataset, &dataset_params, gdal_read_advice)?;

let grid_and_props: GridAndProperties<u8, GridBoundingBox2D> = reader_payload.into();
Ok(grid_and_props.into())
Expand Down Expand Up @@ -1144,8 +1143,10 @@ mod tests {

// file not found => specific error
match result {
Err(IpcProcessError::GdalError { kind, .. })
if kind == IpcProcessGdalErrorKind::FileNotFound => {}
Err(IpcProcessError::GdalError {
kind: IpcProcessGdalErrorKind::FileNotFound,
..
}) => {}
_ => panic!("expected FileNotFound error"),
}

Expand Down Expand Up @@ -1235,8 +1236,10 @@ mod tests {

// file not found => specific error
match result {
Err(IpcProcessError::GdalError { kind, .. })
if kind == IpcProcessGdalErrorKind::FileNotFound => {}
Err(IpcProcessError::GdalError {
kind: IpcProcessGdalErrorKind::FileNotFound,
..
}) => {}
_ => panic!("expected FileNotFound error"),
}

Expand Down
18 changes: 10 additions & 8 deletions geoengine/operators/src/source/gdal_worker_process/process_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,7 @@ mod tests {
#[test]
fn score_exact_match_fresh() {
let w = window([100, 100], [200, 200]);
let aff = make_affinity(42, 1, w.clone());
let aff = make_affinity(42, 1, w);
let score = aff.calculate_score(42, 1, &w, aff.timestamp);

assert_approx_eq!(
Expand All @@ -1058,7 +1058,7 @@ mod tests {
#[test]
fn score_different_band_same_dataset() {
let w = window([0, 0], [7, 7]);
let aff = make_affinity(42, 1, w.clone());
let aff = make_affinity(42, 1, w);
let score = aff.calculate_score(42, 2, &w, aff.timestamp);

assert_approx_eq!(f64, score, SCORE_DATASET_MATCH);
Expand All @@ -1067,7 +1067,7 @@ mod tests {
#[test]
fn score_different_dataset() {
let w = window([0, 0], [7, 7]);
let aff = make_affinity(42, 1, w.clone());
let aff = make_affinity(42, 1, w);
let score = aff.calculate_score(99, 1, &w, aff.timestamp);

assert_approx_eq!(f64, score, 0.0);
Expand All @@ -1076,8 +1076,10 @@ mod tests {
#[test]
fn score_expired_cache() {
let w = window([0, 0], [7, 7]);
let mut aff = make_affinity(42, 1, w.clone());
aff.timestamp = Instant::now() - Duration::from_secs_f64(CACHE_TTL_SECS + 1.0);
let mut aff = make_affinity(42, 1, w);
aff.timestamp = Instant::now()
.checked_sub(Duration::from_secs_f64(CACHE_TTL_SECS + 1.0))
.unwrap();
let score = aff.calculate_score(42, 1, &w, Instant::now());

assert_approx_eq!(f64, score, 0.0);
Expand Down Expand Up @@ -1145,8 +1147,8 @@ mod tests {
GridIdx2D::new([0, 0]),
GridShape2D::new([256, 256]),
),
read_window_bounds: w.clone(),
bounds_of_target: w.clone(),
read_window_bounds: w,
bounds_of_target: w,
flip_y: false,
},
data_type: RasterDataType::U8,
Expand Down Expand Up @@ -1287,7 +1289,7 @@ mod tests {
let dispatcher = GdalPoolDispatcher::new(pool);

let w = window([0, 0], [255, 255]);
let (msg_a, _) = make_request(42, 1, w.clone());
let (msg_a, _) = make_request(42, 1, w);
let (msg_b, _) = make_request(42, 1, w);

let d1 = dispatcher.clone();
Expand Down
Loading
Loading