# HG changeset patch # User Yuya Nishihara # Date 2019-09-08 03:00:26 # Node ID 7083ac37314f1d68fef6039af1ec79761a9d3dc3 # Parent a03a29462c0a359da10437561d0a48a8f8aab624 rust-dirstate: provide CopyMapIter and StateMapIter types They will be used in the declaration of Python iterator types. diff --git a/rust/hg-core/src/dirstate.rs b/rust/hg-core/src/dirstate.rs --- a/rust/hg-core/src/dirstate.rs +++ b/rust/hg-core/src/dirstate.rs @@ -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 struct DirstateEntry { } 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 --git a/rust/hg-core/src/lib.rs b/rust/hg-core/src/lib.rs --- a/rust/hg-core/src/lib.rs +++ b/rust/hg-core/src/lib.rs @@ -12,7 +12,8 @@ pub use dirstate::{ 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;