summaryrefslogtreecommitdiffstats
path: root/src/proof.rs
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2025-06-17 08:22:19 +0000
committerSanto Cariotti <santo@dcariotti.me>2025-06-17 08:22:19 +0000
commita8ec3cf0e32ab3bd2e824e2c2b622b7ecaac6b0e (patch)
tree48cf8ad7a12a81340b00947a888f259f953ea35a /src/proof.rs
parent10b0ddf49d9aabbf37a5139da3ae98e2ef2c6cdd (diff)
Use `.last()` for better readability
Diffstat (limited to 'src/proof.rs')
-rw-r--r--src/proof.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/proof.rs b/src/proof.rs
index cfc7a0b..4acfea6 100644
--- a/src/proof.rs
+++ b/src/proof.rs
@@ -77,7 +77,7 @@ impl Proofer for DefaultProofer<'_> {
while current_level.len() > 1 {
// Ensure even number of nodes at this level
if current_level.len() % 2 != 0 {
- current_level.push(current_level[current_level.len() - 1].clone());
+ current_level.push(current_level.last().unwrap().clone());
}
// Find the sibling of the current node