rust/hg-core/src/lib.rs
changeset 50857 f50e71fdfcb4
parent 50532 a8531bd9210b
child 50863 c112cc9effdc
--- a/rust/hg-core/src/lib.rs	Wed Aug 02 09:59:49 2023 -0400
+++ b/rust/hg-core/src/lib.rs	Tue Aug 08 11:50:26 2023 -0400
@@ -66,6 +66,12 @@
     InvalidPath(HgPathError),
 }
 
+impl From<HgPathError> for DirstateMapError {
+    fn from(error: HgPathError) -> Self {
+        Self::InvalidPath(error)
+    }
+}
+
 impl fmt::Display for DirstateMapError {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         match self {
@@ -83,6 +89,12 @@
     Common(errors::HgError),
 }
 
+impl From<HgPathError> for DirstateError {
+    fn from(error: HgPathError) -> Self {
+        Self::Map(DirstateMapError::InvalidPath(error))
+    }
+}
+
 impl fmt::Display for DirstateError {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         match self {