rust: remove an unused error variant DirstateMapError::EmptyPath
authorArseniy Alekseyev <aalekseyev@janestreet.com>
Wed, 31 May 2023 18:18:52 +0100
changeset 50535 a8531bd9210b
parent 50534 057639af827c
child 50536 475c170bb815
rust: remove an unused error variant DirstateMapError::EmptyPath
rust/hg-core/src/lib.rs
rust/hg-cpython/src/dirstate/dirs_multiset.rs
--- a/rust/hg-core/src/lib.rs	Thu Apr 20 16:07:47 2023 -0400
+++ b/rust/hg-core/src/lib.rs	Wed May 31 18:18:52 2023 +0100
@@ -63,7 +63,6 @@
 #[derive(Debug, PartialEq)]
 pub enum DirstateMapError {
     PathNotFound(HgPathBuf),
-    EmptyPath,
     InvalidPath(HgPathError),
 }
 
@@ -73,9 +72,6 @@
             DirstateMapError::PathNotFound(_) => {
                 f.write_str("expected a value, found none")
             }
-            DirstateMapError::EmptyPath => {
-                f.write_str("Overflow in dirstate.")
-            }
             DirstateMapError::InvalidPath(path_error) => path_error.fmt(f),
         }
     }
--- a/rust/hg-cpython/src/dirstate/dirs_multiset.rs	Thu Apr 20 16:07:47 2023 -0400
+++ b/rust/hg-cpython/src/dirstate/dirs_multiset.rs	Wed May 31 18:18:52 2023 +0100
@@ -17,7 +17,7 @@
 
 use hg::{
     utils::hg_path::{HgPath, HgPathBuf},
-    DirsMultiset, DirsMultisetIter, DirstateMapError,
+    DirsMultiset, DirsMultisetIter,
 };
 
 py_class!(pub class Dirs |py| {
@@ -56,9 +56,6 @@
             HgPath::new(path.extract::<PyBytes>(py)?.data(py)),
         ).and(Ok(py.None())).or_else(|e| {
             match e {
-                DirstateMapError::EmptyPath => {
-                    Ok(py.None())
-                },
                 e => {
                     Err(PyErr::new::<exc::ValueError, _>(
                         py,
@@ -76,9 +73,6 @@
             .and(Ok(py.None()))
             .or_else(|e| {
                 match e {
-                    DirstateMapError::EmptyPath => {
-                        Ok(py.None())
-                    },
                     e => {
                         Err(PyErr::new::<exc::ValueError, _>(
                             py,