--- 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 {