From: Ian Jackson Date: Mon, 10 Aug 2020 19:39:59 +0000 (+0100) Subject: delete old stuff X-Git-Tag: otter-0.2.0~1140 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=64f47f5cd14bbf5c4d08bdc80896381278398b73;p=otter.git delete old stuff --- 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