We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cba52df commit 4370fd8Copy full SHA for 4370fd8
sim-rs/sim-core/src/events.rs
@@ -289,7 +289,7 @@ impl<Node: Display> Serialize for Votes<Node> {
289
pub struct EventTracker {
290
sender: mpsc::UnboundedSender<(Event, Timestamp)>,
291
clock: Clock,
292
- node_names: BTreeMap<NodeId, Arc<String>>,
+ node_names: Arc<BTreeMap<NodeId, Arc<String>>>,
293
}
294
295
impl EventTracker {
@@ -298,10 +298,12 @@ impl EventTracker {
298
299
nodes: &[NodeConfiguration],
300
) -> Self {
301
- let node_names = nodes
302
- .iter()
303
- .map(|n| (n.id, Arc::new(n.name.clone())))
304
- .collect();
+ let node_names = Arc::new(
+ nodes
+ .iter()
+ .map(|n| (n.id, Arc::new(n.name.clone())))
305
+ .collect(),
306
+ );
307
Self {
308
sender,
309
clock,
0 commit comments