Skip to content

Commit

Permalink
Merge pull request #250 from sr-gi/2024-01-patch-clippy
Browse files Browse the repository at this point in the history
plugin: patches clippy
  • Loading branch information
sr-gi authored Mar 20, 2024
2 parents a4acced + e6495c3 commit a515118
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion teos/src/tx_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion teos/src/watcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions watchtower-plugin/src/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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) => {
Expand Down

0 comments on commit a515118

Please sign in to comment.