diff rust/hg-core/src/dirstate.rs @ 42892:7083ac37314f

rust-dirstate: provide CopyMapIter and StateMapIter types They will be used in the declaration of Python iterator types.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 08 Sep 2019 12:00:26 +0900
parents 2e1f74cc3350
children 7a01778bc7b7
line wrap: on
line diff
--- 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<Vec<u8>, DirstateEntry>;
+pub type StateMapIter<'a> = hash_map::Iter<'a, Vec<u8>, DirstateEntry>;
 pub type CopyMap = HashMap<Vec<u8>, Vec<u8>>;
+pub type CopyMapIter<'a> = hash_map::Iter<'a, Vec<u8>, Vec<u8>>;
 
 #[derive(Copy, Clone, Debug, Eq, PartialEq)]
 pub enum EntryState {