diff options
| author | Arthur Carcano <arthur.carcano@ocamlpro.com> | 2024-01-03 17:45:41 +0100 |
|---|---|---|
| committer | Arthur Carcano <arthur.carcano@ocamlpro.com> | 2024-03-12 10:59:40 +0100 |
| commit | ccd99b384e3fcd4b1f53f471cced72647bc7c445 (patch) | |
| tree | 1436068e8735db59515765a8ca95f4b5f2655ea6 /library/alloc/src/collections | |
| parent | a0fe4138ed83b9c3f6e1c85ef6e6a0846b1e542d (diff) | |
| download | rust-ccd99b384e3fcd4b1f53f471cced72647bc7c445.tar.gz rust-ccd99b384e3fcd4b1f53f471cced72647bc7c445.zip | |
Remove unused fields in some structures
The dead_code lint was previously eroneously missing those. Since this lint bug has been fixed, the unused fields need to be removed.
Diffstat (limited to 'library/alloc/src/collections')
| -rw-r--r-- | library/alloc/src/collections/btree/navigate.rs | 6 | ||||
| -rw-r--r-- | library/alloc/src/collections/btree/node/tests.rs | 6 |
2 files changed, 4 insertions, 8 deletions
diff --git a/library/alloc/src/collections/btree/navigate.rs b/library/alloc/src/collections/btree/navigate.rs index a85a3162451..5e6a26f65c4 100644 --- a/library/alloc/src/collections/btree/navigate.rs +++ b/library/alloc/src/collections/btree/navigate.rs @@ -655,7 +655,7 @@ impl<BorrowType: marker::BorrowType, K, V> NodeRef<BorrowType, K, V, marker::Lea pub enum Position<BorrowType, K, V> { Leaf(NodeRef<BorrowType, K, V, marker::Leaf>), Internal(NodeRef<BorrowType, K, V, marker::Internal>), - InternalKV(Handle<NodeRef<BorrowType, K, V, marker::Internal>, marker::KV>), + InternalKV, } impl<'a, K: 'a, V: 'a> NodeRef<marker::Immut<'a>, K, V, marker::LeafOrInternal> { @@ -677,7 +677,7 @@ impl<'a, K: 'a, V: 'a> NodeRef<marker::Immut<'a>, K, V, marker::LeafOrInternal> visit(Position::Leaf(leaf)); match edge.next_kv() { Ok(kv) => { - visit(Position::InternalKV(kv)); + visit(Position::InternalKV); kv.right_edge() } Err(_) => return, @@ -699,7 +699,7 @@ impl<'a, K: 'a, V: 'a> NodeRef<marker::Immut<'a>, K, V, marker::LeafOrInternal> self.visit_nodes_in_order(|pos| match pos { Position::Leaf(node) => result += node.len(), Position::Internal(node) => result += node.len(), - Position::InternalKV(_) => (), + Position::InternalKV => (), }); result } diff --git a/library/alloc/src/collections/btree/node/tests.rs b/library/alloc/src/collections/btree/node/tests.rs index 64bce0ff8c0..d230749d712 100644 --- a/library/alloc/src/collections/btree/node/tests.rs +++ b/library/alloc/src/collections/btree/node/tests.rs @@ -32,11 +32,7 @@ impl<'a, K: 'a, V: 'a> NodeRef<marker::Immut<'a>, K, V, marker::LeafOrInternal> result += &format!("\n{}{:?}", indent, leaf.keys()); } navigate::Position::Internal(_) => {} - navigate::Position::InternalKV(kv) => { - let depth = self.height() - kv.into_node().height(); - let indent = " ".repeat(depth); - result += &format!("\n{}{:?}", indent, kv.into_kv().0); - } + navigate::Position::InternalKV => {} }); result } |
