rust-dirstatemap: use `DirstateEntry::tracked` directly
authorRaphaël Gomès <rgomes@octobus.net>
Tue, 29 Mar 2022 17:23:24 +0200
changeset 49178 afe60def963d
parent 49177 861dd252e2dc
child 49179 d9a66d62c604
rust-dirstatemap: use `DirstateEntry::tracked` directly `state()` is a legacy API that will be removed at some point, let's use the newer API. Differential Revision: https://phab.mercurial-scm.org/D12521
rust/hg-core/src/dirstate_tree/dirstate_map.rs
--- a/rust/hg-core/src/dirstate_tree/dirstate_map.rs	Tue Mar 29 00:58:58 2022 +0200
+++ b/rust/hg-core/src/dirstate_tree/dirstate_map.rs	Tue Mar 29 17:23:24 2022 +0200
@@ -988,9 +988,7 @@
         &mut self,
         filename: &HgPath,
     ) -> Result<(), DirstateError> {
-        let was_tracked = self
-            .get(filename)?
-            .map_or(false, |e| e.state().is_tracked());
+        let was_tracked = self.get(filename)?.map_or(false, |e| e.tracked());
         struct Dropped {
             was_tracked: bool,
             had_entry: bool,