# HG changeset patch # User Raphaël Gomès # Date 2022-04-12 15:30:34 # Node ID 748ac6400eaa09dfd3acde86584430adc364cc24 # Parent 7241b3721ba575667afe03f59cae465972ea5927 rust-dirstatemap: stop using `state()` in the cache logic Let's use the new API Differential Revision: https://phab.mercurial-scm.org/D12538 diff --git a/rust/hg-core/src/dirstate_tree/dirstate_map.rs b/rust/hg-core/src/dirstate_tree/dirstate_map.rs --- a/rust/hg-core/src/dirstate_tree/dirstate_map.rs +++ b/rust/hg-core/src/dirstate_tree/dirstate_map.rs @@ -1182,8 +1182,8 @@ impl OwningDirstateMap { if let Some(node) = map.get_node(directory)? { // A node without a `DirstateEntry` was created to hold child // nodes, and is therefore a directory. - let state = node.state()?; - Ok(state.is_none() && node.tracked_descendants_count() > 0) + let is_dir = node.entry()?.is_none(); + Ok(is_dir && node.tracked_descendants_count() > 0) } else { Ok(false) } @@ -1198,8 +1198,8 @@ impl OwningDirstateMap { if let Some(node) = map.get_node(directory)? { // A node without a `DirstateEntry` was created to hold child // nodes, and is therefore a directory. - let state = node.state()?; - Ok(state.is_none() && node.descendants_with_entry_count() > 0) + let is_dir = node.entry()?.is_none(); + Ok(is_dir && node.descendants_with_entry_count() > 0) } else { Ok(false) }