diff --git a/src/index.rs b/src/index.rs index 38ce19a9b3..6251d09229 100644 --- a/src/index.rs +++ b/src/index.rs @@ -1708,7 +1708,7 @@ impl Index { Utc::now() .round_subsecs(0) .checked_add_signed(chrono::Duration::seconds( - 10 * 60 * i64::try_from(expected_blocks)?, + 10 * 60 * i64::from(expected_blocks), )) .ok_or_else(|| anyhow!("block timestamp out of range"))?, )) diff --git a/src/index/updater.rs b/src/index/updater.rs index 44d6bc805b..aa8fe3178f 100644 --- a/src/index/updater.rs +++ b/src/index/updater.rs @@ -498,7 +498,7 @@ impl<'index> Updater<'_> { coinbase_inputs.extend(input_sat_ranges); } - if let Some((tx, txid)) = block.txdata.get(0) { + if let Some((tx, txid)) = block.txdata.first() { self.index_transaction_sats( tx, *txid, diff --git a/src/templates/blocks.rs b/src/templates/blocks.rs index 52cc492e5a..570b506c72 100644 --- a/src/templates/blocks.rs +++ b/src/templates/blocks.rs @@ -14,7 +14,7 @@ impl BlocksHtml { ) -> Self { Self { last: blocks - .get(0) + .first() .map(|(height, _)| height) .cloned() .unwrap_or(0), diff --git a/tests/server.rs b/tests/server.rs index 4aa0a4ee24..ff5579f043 100644 --- a/tests/server.rs +++ b/tests/server.rs @@ -250,7 +250,7 @@ fn inscription_metadata() { .rpc_server(&rpc_server) .run_and_deserialize_output::() .inscriptions - .get(0) + .first() .unwrap() .id;