chiark / gitweb /
piece insert sort of works but js doesn't do the thing
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 26 Jul 2020 23:27:51 +0000 (00:27 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 26 Jul 2020 23:27:51 +0000 (00:27 +0100)
src/cmdlistener.rs

index 8a2167a4fcf71387e35ea8676dbc5d9d15a252b2..948986e6c33e38161c68a530913d3709ae71fcad 100644 (file)
@@ -199,7 +199,7 @@ fn do_authorise_scope(cs: &CommandStream, wanted: &ManagementScope)
 
 #[throws(ME)]
 fn execute(cs: &mut CommandStream, cmd: MgmtCommand) -> MgmtResponse {
-//  use MgmtError::*;
+  eprintln!("{:?} executing {:?}", &cs.desc, &cmd);
 
   match cmd {
     Noop { } => Fine { },
@@ -266,7 +266,7 @@ fn execute(cs: &mut CommandStream, cmd: MgmtCommand) -> MgmtResponse {
 
 #[derive(Debug,Default)]
 struct UpdateHandlerBulk {
-  pieces : SecondarySlotMap<PieceId, PieceUpdateOp<()>>,
+  pieces : slotmap::SparseSecondaryMap<PieceId, PieceUpdateOp<()>>,
 }
 
 #[derive(Debug)]
@@ -301,7 +301,7 @@ impl UpdateHandler {
             ( _                  , _        ) => Some( Modify(()) ),
           };
           match ne {
-            Some(ne) => { bulk.pieces[upiece] = ne; },
+            Some(ne) => { bulk.pieces.insert(upiece, ne); },
             None     => { bulk.pieces.remove(upiece); },
           };
         }