diff rust/hg-core/src/operations/list_tracked_files.rs @ 46435:2e2033081274

rust: replace trivial `impl From …` with `#[derive(derive_more::From)]` Crate docs: https://jeltef.github.io/derive_more/derive_more/from.html Differential Revision: https://phab.mercurial-scm.org/D9875
author Simon Sapin <simon.sapin@octobus.net>
date Tue, 26 Jan 2021 20:05:37 +0100
parents 3e2d539d0d1a
children b274aa2f20fd
line wrap: on
line diff
--- a/rust/hg-core/src/operations/list_tracked_files.rs	Tue Jan 26 19:07:24 2021 +0100
+++ b/rust/hg-core/src/operations/list_tracked_files.rs	Tue Jan 26 20:05:37 2021 +0100
@@ -17,7 +17,7 @@
 use std::convert::From;
 
 /// Error type for `Dirstate` methods
-#[derive(Debug)]
+#[derive(Debug, derive_more::From)]
 pub enum ListDirstateTrackedFilesError {
     /// Error when reading the `dirstate` file
     IoError(std::io::Error),
@@ -25,12 +25,6 @@
     ParseError(DirstateParseError),
 }
 
-impl From<std::io::Error> for ListDirstateTrackedFilesError {
-    fn from(err: std::io::Error) -> Self {
-        ListDirstateTrackedFilesError::IoError(err)
-    }
-}
-
 /// List files under Mercurial control in the working directory
 /// by reading the dirstate
 pub struct Dirstate {