chiark / gitweb /
cmd updates: Shuffle some variables
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 1 Apr 2021 10:05:38 +0000 (11:05 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 1 Apr 2021 10:38:14 +0000 (11:38 +0100)
For neatness and clarity.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
daemon/cmdlistener.rs

index 926cfe6ceb8af881dd40f4e700afcb6239b6c7f8..349ef0c371617af37e17d0f06590a8ebdc3e52ae 100644 (file)
@@ -845,14 +845,6 @@ fn execute_for_game<'cs, 'igr, 'ig: 'igr>(
   let (ok, uu) = ToRecalculate::with(|mut to_permute| {
     let r = (||{
 
-  let mut responses = Vec::with_capacity(insns.len());
-  struct St {
-    uh: UpdateHandler,
-    auth: Authorisation<InstanceName>,
-    have_deleted: bool,
-  }
-  let mut uh_auth: Option<St> = None;
-  let mk_uh = || UpdateHandler::from_how(how);
   let who = if_chain! {
     let account = &cs.current_account()?.notional_account;
     let ig = igu.by_ref(Authorisation::authorise_any());
@@ -867,6 +859,17 @@ fn execute_for_game<'cs, 'igr, 'ig: 'igr>(
     else { hformat!("[{}]",
                         account) }
   };
+
+  let mut responses = Vec::with_capacity(insns.len());
+
+  struct St {
+    uh: UpdateHandler,
+    auth: Authorisation<InstanceName>,
+    have_deleted: bool,
+  }
+  let mut uh_auth: Option<St> = None;
+
+  let mk_uh = || UpdateHandler::from_how(how);
   let res = (||{
     for insn in insns.drain(0..) {
       trace_dbg!("exeucting game insns", insn);