From 64f47f5cd14bbf5c4d08bdc80896381278398b73 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 10 Aug 2020 20:39:59 +0100 Subject: [PATCH] delete old stuff --- src/bin/otter.rs | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/src/bin/otter.rs b/src/bin/otter.rs index b12cbd72..21a75885 100644 --- a/src/bin/otter.rs +++ b/src/bin/otter.rs @@ -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, -} - -impl<'a,T> CellRef<'a,T> { - pub fn cloning(origin: &mut T) -> CellRef where T: Clone { - let current = Cell::new(origin.clone()); - CellRef { origin, current } - } - pub fn copying(origin: &mut T) -> CellRef where T: Copy { - let current = Cell::new(*origin); - CellRef { origin, current } - } - pub fn defaulting(origin: &mut T) -> CellRef where T: Default { - let current = Cell::new(mem::take(origin)); - CellRef { origin, current } - } - pub fn with_placeholder(origin: &mut T, placeholder: T) -> CellRef { - 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; - fn deref(&self) -> &Cell { &self.current } -} - */ - #[derive(Clone)] struct MapStore Result > ( F -- 2.30.2