diff --git a/teos/src/tx_index.rs b/teos/src/tx_index.rs index a0e4a35..c9d22b4 100644 --- a/teos/src/tx_index.rs +++ b/teos/src/tx_index.rs @@ -276,7 +276,7 @@ mod tests { // last_n_blocks is ordered from latest to earliest let first_block = last_n_blocks.get(cache_size - 1).unwrap(); - let last_block = last_n_blocks.get(0).unwrap(); + let last_block = last_n_blocks.first().unwrap(); let mid = last_n_blocks.get(cache_size / 2).unwrap(); let cache: TxIndex = TxIndex::new(&last_n_blocks, height as u32); diff --git a/teos/src/watcher.rs b/teos/src/watcher.rs index 90606fc..037319d 100644 --- a/teos/src/watcher.rs +++ b/teos/src/watcher.rs @@ -1163,7 +1163,7 @@ mod tests { let mut uuids = HashSet::new(); // Let the watcher track these breaches. - for (_, (_, tx)) in breaches.iter().enumerate() { + for tx in breaches.values() { let (uuid, appointment) = generate_dummy_appointment_with_user(user_id, Some(&tx.txid())); let appointment = appointment.inner; diff --git a/watchtower-plugin/src/convert.rs b/watchtower-plugin/src/convert.rs index ec1b9d0..77ca95a 100644 --- a/watchtower-plugin/src/convert.rs +++ b/watchtower-plugin/src/convert.rs @@ -94,6 +94,8 @@ impl RegisterParams { impl TryFrom for RegisterParams { type Error = RegisterError; + // clippy-fix: We are getting more than just the first item, so this clippy check does not make sense here + #[allow(clippy::get_first)] fn try_from(value: serde_json::Value) -> Result { match value { serde_json::Value::String(s) => { @@ -193,6 +195,8 @@ pub struct GetAppointmentParams { impl TryFrom for GetAppointmentParams { type Error = GetAppointmentError; + // clippy-fix: We are getting more than just the first item, so this clippy check does not make sense here + #[allow(clippy::get_first)] fn try_from(value: serde_json::Value) -> Result { match value { serde_json::Value::Array(a) => {