chiark / gitweb /
delete old stuff
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 10 Aug 2020 19:39:59 +0000 (20:39 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 10 Aug 2020 19:39:59 +0000 (20:39 +0100)
src/bin/otter.rs

index b12cbd72159053b86d0e092c4e83082c3dadba2e..21a75885c047acc644f6613ce8955748a7533df9 100644 (file)
@@ -11,44 +11,6 @@ use std::cell::Cell;
 
 use argparse::action::ParseResult::Parsed;
 
-/*
-use std::cell::Cell;
-
-pub struct CellRef<'a, T> {
-  origin: &'a mut T,
-  current: Cell<T>,
-}
-
-impl<'a,T> CellRef<'a,T> {
-  pub fn cloning(origin: &mut T) -> CellRef<T> where T: Clone {
-    let current = Cell::new(origin.clone());
-    CellRef { origin, current }
-  }
-  pub fn copying(origin: &mut T) -> CellRef<T> where T: Copy {
-    let current = Cell::new(*origin);
-    CellRef { origin, current }
-  }
-  pub fn defaulting(origin: &mut T) -> CellRef<T> where T: Default {
-    let current = Cell::new(mem::take(origin));
-    CellRef { origin, current }
-  }
-  pub fn with_placeholder(origin: &mut T, placeholder: T) -> CellRef<T> {
-    let current = Cell::new(mem::replace(origin, placeholder));
-    CellRef { origin, current }
-  }
-}
-
-impl<'a,T> Drop for CellRef<'a,T> {
-  fn drop(&mut self) {
-    mem::swap(self.current.get_mut(), self.origin);
-  }
-}
-impl<'a,T> Deref for CellRef<'a,T> {
-  type Target = Cell<T>;
-  fn deref(&self) -> &Cell<T> { &self.current }
-}
- */
-
 #[derive(Clone)]
 struct MapStore<T, F: FnMut(&str) -> Result<T,String> > (
   F