diff rust/hg-core/src/dirstate/dirstate_map.rs @ 42818:2e1f74cc3350

rust-dirstate: split DirsMultiset constructor per input type Since skip_state only applies to dirstate, it doesn't make sense to unify these constructors and dispatch by enum.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 17 Aug 2019 18:25:29 +0900
parents 1a535313ad1b
children b1b984f9c01d
line wrap: on
line diff
--- a/rust/hg-core/src/dirstate/dirstate_map.rs	Sat Aug 17 16:33:05 2019 +0900
+++ b/rust/hg-core/src/dirstate/dirstate_map.rs	Sat Aug 17 18:25:29 2019 +0900
@@ -7,9 +7,9 @@
 
 use crate::{
     dirstate::{parsers::PARENT_SIZE, EntryState},
-    pack_dirstate, parse_dirstate, CopyMap, DirsIterable, DirsMultiset,
-    DirstateEntry, DirstateError, DirstateMapError, DirstateParents,
-    DirstateParseError, StateMap,
+    pack_dirstate, parse_dirstate, CopyMap, DirsMultiset, DirstateEntry,
+    DirstateError, DirstateMapError, DirstateParents, DirstateParseError,
+    StateMap,
 };
 use core::borrow::Borrow;
 use std::collections::{HashMap, HashSet};
@@ -224,17 +224,15 @@
     /// good idea.
     pub fn set_all_dirs(&mut self) {
         if self.all_dirs.is_none() {
-            self.all_dirs = Some(DirsMultiset::new(
-                DirsIterable::Dirstate(&self.state_map),
-                None,
-            ));
+            self.all_dirs =
+                Some(DirsMultiset::from_dirstate(&self.state_map, None));
         }
     }
 
     pub fn set_dirs(&mut self) {
         if self.dirs.is_none() {
-            self.dirs = Some(DirsMultiset::new(
-                DirsIterable::Dirstate(&self.state_map),
+            self.dirs = Some(DirsMultiset::from_dirstate(
+                &self.state_map,
                 Some(EntryState::Removed),
             ));
         }