chiark / gitweb /
hidden: Declare new status of Lens
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 30 Jan 2021 23:04:51 +0000 (23:04 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 31 Jan 2021 18:38:28 +0000 (18:38 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/lens.rs

index cd6fdae12519eedcb0880560ed0a16bdb1514231..e21e91881cac32a9afb3d339e36fcabc491f16e3 100644 (file)
@@ -4,7 +4,16 @@
 
 use crate::imports::*;
 
+// this ios going to be replaced with new "hidden" machiner
+//
+// For now, we are firstly removing all calls to everything except
+// new_hidden_todo.
+//
+// Then we'll adjust all call sites of new_hidden_todo too and Lens
+// can be abolished.
+
 pub trait Lens : Debug {
+  fn new_hidden_todo(&self, why: &'static str);
   fn pieceid2visible(&self, piece: PieceId) -> VisiblePieceId;
   fn log_pri(&self, piece: PieceId, pc: &PieceState)
              -> PieceRenderInstructions;
@@ -16,10 +25,9 @@ pub trait Lens : Debug {
 }
 #[derive(Debug)]
 pub struct TransparentLens {
-  // when lenses become nontrivial, make this nonconstructable
-  // to find all the places where a TransparentLens was bodged
 }
 impl Lens for TransparentLens {
+  fn new_hidden_todo(&self, _why: &'static str) { }
   fn pieceid2visible(&self, piece: PieceId) -> VisiblePieceId {
     let kd : slotmap::KeyData = piece.data();
     VisiblePieceId(kd)