Mercurial > public > mercurial-scm > hg-stable
diff rust/hg-core/src/dirstate/entry.rs @ 48048:1b2ee68e85f9
rust: Remove EntryState::Unknown
This enum variant represented the `state == '?'` case, which was used
to represent the absence of a dirstate entry/item (and therefore of that
entry?s state).
Now that previous refactors have removed this use in the Python/Rust
FFI APIs, the remaining uses can be removed by replacing `EntryState`
by `Option<EntryState>` where appropriate, using `None` to represent
the absence of an entry.
Differential Revision: https://phab.mercurial-scm.org/D11465
author | Simon Sapin <simon.sapin@octobus.net> |
---|---|
date | Mon, 20 Sep 2021 20:55:38 +0200 |
parents | f2a9db29cb2d |
children | 008959fcbfb2 |
line wrap: on
line diff
--- a/rust/hg-core/src/dirstate/entry.rs Mon Sep 20 20:21:35 2021 +0200 +++ b/rust/hg-core/src/dirstate/entry.rs Mon Sep 20 20:55:38 2021 +0200 @@ -7,7 +7,6 @@ Added, Removed, Merged, - Unknown, } /// The C implementation uses all signed types. This will be an issue @@ -157,7 +156,7 @@ use EntryState::*; match self { Normal | Added | Merged => true, - Removed | Unknown => false, + Removed => false, } } } @@ -171,7 +170,6 @@ b'a' => Ok(EntryState::Added), b'r' => Ok(EntryState::Removed), b'm' => Ok(EntryState::Merged), - b'?' => Ok(EntryState::Unknown), _ => Err(HgError::CorruptedRepository(format!( "Incorrect dirstate entry state {}", value @@ -187,7 +185,6 @@ EntryState::Added => b'a', EntryState::Removed => b'r', EntryState::Merged => b'm', - EntryState::Unknown => b'?', } } }