Skip to content

Commit 8ce9ec1

Browse files
fix(clippy): remove dead code and use or_default()
- Removed unused methods expect_sub_operation and register_sub_operation - Changed or_insert_with(HashSet::new) to or_default() for cleaner code Co-authored-by: nacho.d.g <iduartgomez@users.noreply.github.com>
1 parent 5eb1348 commit 8ce9ec1

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

crates/core/src/node/op_state_manager.rs

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -467,25 +467,6 @@ impl OpManager {
467467
}
468468
}
469469

470-
/// Registers an expected child operation for the parent transaction.
471-
/// Must be called before spawning the child to prevent completion race conditions.
472-
pub fn expect_sub_operation(&self, parent: Transaction) {
473-
self.expected_sub_operations
474-
.entry(parent)
475-
.and_modify(|count| *count += 1)
476-
.or_insert(1);
477-
}
478-
479-
/// Registers parent-child transaction relationship for atomicity tracking.
480-
pub fn register_sub_operation(&self, parent: Transaction, child: Transaction) {
481-
self.sub_operations
482-
.entry(parent)
483-
.or_insert_with(HashSet::new)
484-
.insert(child);
485-
486-
self.parent_of.insert(child, parent);
487-
}
488-
489470
/// Atomically registers both expected count and parent-child relationship.
490471
/// This prevents race conditions where children complete before registration.
491472
pub fn expect_and_register_sub_operation(&self, parent: Transaction, child: Transaction) {
@@ -498,7 +479,7 @@ impl OpManager {
498479
// Register parent-child relationship
499480
self.sub_operations
500481
.entry(parent)
501-
.or_insert_with(HashSet::new)
482+
.or_default()
502483
.insert(child);
503484

504485
self.parent_of.insert(child, parent);

0 commit comments

Comments
 (0)