Skip to content

Commit c210a79

Browse files
committed
refactor how balancer context is initialized
1 parent 534f31d commit c210a79

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

crates/ott-balancer/src/balancer.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ impl BalancerLink {
171171
}
172172
}
173173

174-
#[derive(Debug)]
174+
#[derive(Debug, Default)]
175175
pub struct BalancerContext {
176176
pub clients: HashMap<ClientId, BalancerClient>,
177177
pub monoliths: HashMap<MonolithId, BalancerMonolith>,
@@ -181,12 +181,7 @@ pub struct BalancerContext {
181181

182182
impl BalancerContext {
183183
pub fn new() -> Self {
184-
Self {
185-
clients: HashMap::new(),
186-
monoliths: HashMap::new(),
187-
rooms_to_monoliths: HashMap::new(),
188-
monoliths_by_region: HashMap::new(),
189-
}
184+
Default::default()
190185
}
191186

192187
#[instrument(skip(self, client), err, fields(client_id = %client.id, room = %client.room))]

0 commit comments

Comments
 (0)