From: Ian Jackson Date: Mon, 2 May 2022 10:25:18 +0000 (+0100) Subject: utils: Drop some unused bits X-Git-Tag: otter-1.1.0~316 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=ad5198c2876f0896c7572738431984db21740786;p=otter.git utils: Drop some unused bits Signed-off-by: Ian Jackson --- diff --git a/src/utils.rs b/src/utils.rs index f10e8418..35f75d13 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -5,39 +5,11 @@ use crate::imports::*; use crate::prelude::*; -/* -put trait OptionExt { - type Output; - fn get_or_try_insert_with< - E: Error, - F: FnOnce() -> Result, - >(&mut self, f: F) -> Result<&mut Output, E>; -} - -impl OptionExt for Option { - type Output = T; - fn get_or_try_insert_with - (&mut self, f: F) -> Result<&mut Output, E> - where E: Error, F: FnOnce() -> Result, - { - if self.is_none() { - *self = Some(f()?); - } - Ok(self.as_mut().unwrap()) - } -} -*/ - //========== miscellany ========== // (roughly in order of implementation length) pub fn is_default(t: &T) -> bool { t == &T::DEFAULT } -// TODO: this is not used anywhere! -#[derive(Error,Clone,Copy,Debug,Eq,PartialEq,Serialize,Deserialize)] -#[error("error parsing Z coordinate")] -pub struct FooParseError; - #[ext(pub, name=SeekExt)] impl T { #[throws(io::Error)]