From e24152739f7fc6b731c1e63e1dd240e3cee1370b Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 1 May 2021 13:20:57 +0100 Subject: [PATCH] global: Slightly reorganise InstanceOuter construction Tidier, and makes space for bundles. Signed-off-by: Ian Jackson --- src/global.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/global.rs b/src/global.rs index cc247f42..fc712955 100644 --- a/src/global.rs +++ b/src/global.rs @@ -335,14 +335,15 @@ impl Instance { links: default(), }; - let cont = InstanceContainer { + let c = InstanceContainer { live: true, game_dirty: false, aux_dirty: false, g, }; - let gref = InstanceRef(Arc::new(InstanceOuter { c: Mutex::new(cont) })); + let c = Mutex::new(c); + let gref = InstanceRef(Arc::new(InstanceOuter { c })); let mut ig = gref.lock()?; let entry = games.entry(name); @@ -1121,13 +1122,14 @@ impl InstanceGuard<'_> { tokens_clients: default(), tokens_players: default(), }; - let cont = InstanceContainer { + let c = InstanceContainer { live: true, game_dirty: false, aux_dirty: false, g, }; - let gref = InstanceRef(Arc::new(InstanceOuter { c: Mutex::new(cont) })); + let c = Mutex::new(c); + let gref = InstanceRef(Arc::new(InstanceOuter { c })); let mut g = gref.lock().unwrap(); let ig = &mut *g; -- 2.30.2