# HG changeset patch # User Yuya Nishihara # Date 1567911626 -32400 # Node ID 7083ac37314f1d68fef6039af1ec79761a9d3dc3 # Parent a03a29462c0a359da10437561d0a48a8f8aab624 rust-dirstate: provide CopyMapIter and StateMapIter types They will be used in the declaration of Python iterator types. diff -r a03a29462c0a -r 7083ac37314f rust/hg-core/src/dirstate.rs --- a/rust/hg-core/src/dirstate.rs Sun Sep 08 11:55:29 2019 +0900 +++ b/rust/hg-core/src/dirstate.rs Sun Sep 08 12:00:26 2019 +0900 @@ -6,6 +6,7 @@ // GNU General Public License version 2 or any later version. use crate::DirstateParseError; +use std::collections::hash_map; use std::collections::HashMap; use std::convert::TryFrom; @@ -31,7 +32,9 @@ } pub type StateMap = HashMap, DirstateEntry>; +pub type StateMapIter<'a> = hash_map::Iter<'a, Vec, DirstateEntry>; pub type CopyMap = HashMap, Vec>; +pub type CopyMapIter<'a> = hash_map::Iter<'a, Vec, Vec>; #[derive(Copy, Clone, Debug, Eq, PartialEq)] pub enum EntryState { diff -r a03a29462c0a -r 7083ac37314f rust/hg-core/src/lib.rs --- a/rust/hg-core/src/lib.rs Sun Sep 08 11:55:29 2019 +0900 +++ b/rust/hg-core/src/lib.rs Sun Sep 08 12:00:26 2019 +0900 @@ -12,7 +12,8 @@ dirs_multiset::{DirsMultiset, DirsMultisetIter}, dirstate_map::DirstateMap, parsers::{pack_dirstate, parse_dirstate, PARENT_SIZE}, - CopyMap, DirstateEntry, DirstateParents, EntryState, StateMap, + CopyMap, CopyMapIter, DirstateEntry, DirstateParents, EntryState, + StateMap, StateMapIter, }; mod filepatterns; pub mod utils;