Skip to content

Commit b68d0ea

Browse files
committed
fix clippy
1 parent c196944 commit b68d0ea

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

streamstore/src/lib.rs

+9-2
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,21 @@ impl StringPool {
106106
}
107107
}
108108

109+
// Type aliases to simplify complex types
110+
type PooledString = Arc<str>;
111+
type LabelMap = HashMap<PooledString, PooledString>;
112+
type DataStore = RwLock<HashMap<u64, LabelMap>>;
113+
type ValueMap = HashMap<PooledString, HashSet<u64>>;
114+
type LabelIndex = RwLock<HashMap<PooledString, ValueMap>>;
115+
109116
/// Stream storage implementation
110117
pub struct StreamStore {
111118
// Use HashSet to store unique label combinations
112119
streams: RwLock<HashSet<u64>>,
113120
// Store the actual content of label combinations, using pooled strings
114-
data_store: RwLock<HashMap<u64, HashMap<Arc<str>, Arc<str>>>>,
121+
data_store: DataStore,
115122
// Inverted index: label name -> label value -> stream hash values, using pooled strings
116-
label_index: RwLock<HashMap<Arc<str>, HashMap<Arc<str>, HashSet<u64>>>>,
123+
label_index: LabelIndex,
117124
// String pool for deduplication
118125
string_pool: StringPool,
119126
// Maximum number of streams allowed

0 commit comments

Comments
 (0)