chiark / gitweb /
utils: Drop some unused bits
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 2 May 2022 10:25:18 +0000 (11:25 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 2 May 2022 10:25:18 +0000 (11:25 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/utils.rs

index f10e8418adaba0e05220e621635b243b89feb6f0..35f75d133cdeeace14e8439854bc7ab0c0fd65ac 100644 (file)
@@ -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<Output,E>,
-    >(&mut self, f: F) -> Result<&mut Output, E>;
-}
-
-impl<T> OptionExt for Option<T> {
-  type Output = T;
-  fn get_or_try_insert_with<E,F>
-    (&mut self, f: F) -> Result<&mut Output, E>
-    where E: Error, F: FnOnce() -> Result<Output,E>,
-  {
-    if self.is_none() {
-      *self = Some(f()?);
-    }
-    Ok(self.as_mut().unwrap())
-  }
-}
-*/
-
 //========== miscellany ==========
 // (roughly in order of implementation length)
 
 pub fn is_default<T: ConstDefault + Eq>(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: io::Seek> T {
   #[throws(io::Error)]