diff -r 68a15b5a7e58 -r 776b97179c06 rust/hg-cpython/src/parsers.rs --- 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::( - 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::(py, e.to_string())), } }