changeset 48744:6e930bc45aeb

rust: remove unused `StatusError::IO` enum variant All `io::Error` cases are now handled through PatternFileWarning or BadMatch Differential Revision: https://phab.mercurial-scm.org/D12174
author Simon Sapin <simon.sapin@octobus.net>
date Mon, 14 Feb 2022 18:51:43 +0100
parents 00efd2d5037d
children 94e36b230990
files rust/hg-core/src/dirstate/status.rs rust/hg-cpython/src/dirstate/status.rs
diffstat 2 files changed, 0 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/rust/hg-core/src/dirstate/status.rs	Mon Feb 14 18:57:12 2022 +0100
+++ b/rust/hg-core/src/dirstate/status.rs	Mon Feb 14 18:51:43 2022 +0100
@@ -128,8 +128,6 @@
 
 #[derive(Debug, derive_more::From)]
 pub enum StatusError {
-    /// Generic IO error
-    IO(std::io::Error),
     /// An invalid path that cannot be represented in Mercurial was found
     Path(HgPathError),
     /// An invalid "ignore" pattern was found
@@ -143,7 +141,6 @@
 impl fmt::Display for StatusError {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         match self {
-            StatusError::IO(error) => error.fmt(f),
             StatusError::Path(error) => error.fmt(f),
             StatusError::Pattern(error) => error.fmt(f),
             StatusError::DirstateV2ParseError(_) => {
--- a/rust/hg-cpython/src/dirstate/status.rs	Mon Feb 14 18:57:12 2022 +0100
+++ b/rust/hg-cpython/src/dirstate/status.rs	Mon Feb 14 18:51:43 2022 +0100
@@ -10,7 +10,6 @@
 //! `rustext.dirstate.status`.
 
 use crate::{dirstate::DirstateMap, exceptions::FallbackError};
-use cpython::exc::OSError;
 use cpython::{
     exc::ValueError, ObjectProtocol, PyBytes, PyErr, PyList, PyObject,
     PyResult, PyTuple, Python, PythonObject, ToPyObject,
@@ -95,7 +94,6 @@
 
             PyErr::new::<FallbackError, _>(py, &as_string)
         }
-        StatusError::IO(e) => PyErr::new::<OSError, _>(py, e.to_string()),
         e => PyErr::new::<ValueError, _>(py, e.to_string()),
     }
 }