rust/hg-cpython/src/parsers.rs
changeset 46440 776b97179c06
parent 46439 68a15b5a7e58
child 46595 98a455a62699
--- a/rust/hg-cpython/src/parsers.rs	Wed Jan 27 13:41:28 2021 +0100
+++ b/rust/hg-cpython/src/parsers.rs	Wed Jan 27 14:00:21 2021 +0100
@@ -15,7 +15,7 @@
 };
 use hg::{
     pack_dirstate, parse_dirstate, utils::hg_path::HgPathBuf, DirstateEntry,
-    DirstateParents, DirstateParseError, FastHashMap, PARENT_SIZE,
+    DirstateParents, FastHashMap, PARENT_SIZE,
 };
 use std::convert::TryInto;
 
@@ -58,21 +58,7 @@
                     .to_py_object(py),
             )
         }
-        Err(e) => Err(PyErr::new::<exc::ValueError, _>(
-            py,
-            match e {
-                DirstateParseError::TooLittleData => {
-                    "too little data for parents".to_string()
-                }
-                DirstateParseError::Overflow => {
-                    "overflow in dirstate".to_string()
-                }
-                DirstateParseError::CorruptedEntry(e) => e,
-                DirstateParseError::Damaged => {
-                    "dirstate appears to be damaged".to_string()
-                }
-            },
-        )),
+        Err(e) => Err(PyErr::new::<exc::ValueError, _>(py, e.to_string())),
     }
 }