Skip to content

Commit 398b515

Browse files
committed
feat: Change 'replaces' field type from Vec to HashSet in RecordCorrection
1 parent 0751134 commit 398b515

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

audit-trail-rs/src/core/types/record_correction.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11
// Copyright 2020-2025 IOTA Stiftung
22
// SPDX-License-Identifier: Apache-2.0
33

4+
use std::collections::HashSet;
5+
46
use serde::{Deserialize, Serialize};
57

68
/// Bidirectional correction tracking for audit records.
79
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
810
pub struct RecordCorrection {
9-
pub replaces: Vec<u64>,
11+
pub replaces: HashSet<u64>,
1012
pub is_replaced_by: Option<u64>,
1113
}
1214

1315
impl RecordCorrection {
1416
pub fn new() -> Self {
1517
Self {
16-
replaces: Vec::new(),
18+
replaces: HashSet::new(),
1719
is_replaced_by: None,
1820
}
1921
}
2022

21-
pub fn with_replaces(replaces: Vec<u64>) -> Self {
23+
pub fn with_replaces(replaces: HashSet<u64>) -> Self {
2224
Self {
2325
replaces,
2426
is_replaced_by: None,

0 commit comments

Comments
 (0)