@@ -321,15 +321,13 @@ impl<const ARITY: usize> ProvingTree<ARITY> {
321
321
let num_childrens = parent_node. children_keys . len ( ) ;
322
322
let new_child_key = parent_key. children_key ( num_childrens) ;
323
323
let child_node = ProvingTreeNode {
324
- parent_key : Some ( parent_key. clone ( ) ) ,
324
+ parent_key : Some ( * parent_key) ,
325
325
children_keys : vec ! [ ] ,
326
326
} ;
327
327
// insert new child in the set of children of the parent
328
- parent_node. children_keys . push ( new_child_key. clone ( ) ) ;
328
+ parent_node. children_keys . push ( new_child_key) ;
329
329
assert ! (
330
- self . nodes
331
- . insert( new_child_key. clone( ) , child_node)
332
- . is_none( ) ,
330
+ self . nodes. insert( new_child_key, child_node) . is_none( ) ,
333
331
"Node with key {:?} already found in the tree" ,
334
332
new_child_key
335
333
) ;
@@ -342,7 +340,7 @@ impl<const ARITY: usize> ProvingTree<ARITY> {
342
340
} ;
343
341
let root_key = UTKey ( ( 0 , 0 ) ) ;
344
342
assert ! (
345
- self . nodes. insert( root_key. clone ( ) , root) . is_none( ) ,
343
+ self . nodes. insert( root_key, root) . is_none( ) ,
346
344
"Error: root node inserted multiple times"
347
345
) ;
348
346
root_key
@@ -415,7 +413,7 @@ impl<const ARITY: usize> ProvingTree<ARITY> {
415
413
while node_key. is_some ( ) {
416
414
// place node key in the path
417
415
let key = node_key. unwrap ( ) ;
418
- path. push ( key. clone ( ) ) ;
416
+ path. push ( * key) ;
419
417
// fetch key of the parent node, if any
420
418
node_key = self
421
419
. nodes
@@ -452,7 +450,7 @@ impl<const NUM_CHUNKS: usize> UTForChunksBuilder<NUM_CHUNKS> {
452
450
let path = tree. compute_path_for_leaf ( node_index) ;
453
451
(
454
452
(
455
- path. last ( ) . unwrap ( ) . clone ( ) , // chunk node is always a leaf of the tree, so it is the last node
453
+ * path. last ( ) . unwrap ( ) , // chunk node is always a leaf of the tree, so it is the last node
456
454
// in the path
457
455
chunk,
458
456
) ,
0 commit comments