Merge pull request #250 from sr-gi/2024-01-patch-clippy

plugin: patches clippy
This commit is contained in:
Sergi Delgado 2024-03-20 15:32:35 -04:00 committed by GitHub
commit a515118eea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 2 deletions

View file

@ -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<Locator, Transaction> = TxIndex::new(&last_n_blocks, height as u32);

View file

@ -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;

View file

@ -94,6 +94,8 @@ impl RegisterParams {
impl TryFrom<serde_json::Value> 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<Self, Self::Error> {
match value {
serde_json::Value::String(s) => {
@ -193,6 +195,8 @@ pub struct GetAppointmentParams {
impl TryFrom<serde_json::Value> 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<Self, Self::Error> {
match value {
serde_json::Value::Array(a) => {