Mercurial > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
46434:3e2d539d0d1a | 46435:2e2033081274 |
---|---|
15 use crate::{DirstateParseError, EntryState}; | 15 use crate::{DirstateParseError, EntryState}; |
16 use rayon::prelude::*; | 16 use rayon::prelude::*; |
17 use std::convert::From; | 17 use std::convert::From; |
18 | 18 |
19 /// Error type for `Dirstate` methods | 19 /// Error type for `Dirstate` methods |
20 #[derive(Debug)] | 20 #[derive(Debug, derive_more::From)] |
21 pub enum ListDirstateTrackedFilesError { | 21 pub enum ListDirstateTrackedFilesError { |
22 /// Error when reading the `dirstate` file | 22 /// Error when reading the `dirstate` file |
23 IoError(std::io::Error), | 23 IoError(std::io::Error), |
24 /// Error when parsing the `dirstate` file | 24 /// Error when parsing the `dirstate` file |
25 ParseError(DirstateParseError), | 25 ParseError(DirstateParseError), |
26 } | |
27 | |
28 impl From<std::io::Error> for ListDirstateTrackedFilesError { | |
29 fn from(err: std::io::Error) -> Self { | |
30 ListDirstateTrackedFilesError::IoError(err) | |
31 } | |
32 } | 26 } |
33 | 27 |
34 /// List files under Mercurial control in the working directory | 28 /// List files under Mercurial control in the working directory |
35 /// by reading the dirstate | 29 /// by reading the dirstate |
36 pub struct Dirstate { | 30 pub struct Dirstate { |