rust/hg-core/src/lib.rs
changeset 46440 776b97179c06
parent 46439 68a15b5a7e58
child 46443 43d63979a75e
--- a/rust/hg-core/src/lib.rs	Wed Jan 27 13:41:28 2021 +0100
+++ b/rust/hg-core/src/lib.rs	Wed Jan 27 14:00:21 2021 +0100
@@ -51,33 +51,6 @@
 /// write access to your repository, you have other issues.
 pub type FastHashMap<K, V> = HashMap<K, V, RandomXxHashBuilder64>;
 
-#[derive(Clone, Debug, PartialEq)]
-pub enum DirstateParseError {
-    TooLittleData,
-    Overflow,
-    // TODO refactor to use bytes instead of String
-    CorruptedEntry(String),
-    Damaged,
-}
-
-impl From<std::io::Error> for DirstateParseError {
-    fn from(e: std::io::Error) -> Self {
-        DirstateParseError::CorruptedEntry(e.to_string())
-    }
-}
-
-impl ToString for DirstateParseError {
-    fn to_string(&self) -> String {
-        use crate::DirstateParseError::*;
-        match self {
-            TooLittleData => "Too little data for dirstate.".to_string(),
-            Overflow => "Overflow in dirstate.".to_string(),
-            CorruptedEntry(e) => format!("Corrupted entry: {:?}.", e),
-            Damaged => "Dirstate appears to be damaged.".to_string(),
-        }
-    }
-}
-
 #[derive(Debug, PartialEq)]
 pub enum DirstateMapError {
     PathNotFound(HgPathBuf),
@@ -99,9 +72,7 @@
 
 #[derive(Debug, derive_more::From)]
 pub enum DirstateError {
-    Parse(DirstateParseError),
     Map(DirstateMapError),
-    IO(std::io::Error),
     Common(errors::HgError),
 }