##// END OF EJS Templates
rust-dirstate: specify concrete return type of DirsMultiset::iter()...
Yuya Nishihara -
r43155:a03a2946 default
parent child Browse files
Show More
@@ -11,9 +11,12 b''
11 use crate::{
11 use crate::{
12 dirstate::EntryState, utils::files, DirstateEntry, DirstateMapError,
12 dirstate::EntryState, utils::files, DirstateEntry, DirstateMapError,
13 };
13 };
14 use std::collections::hash_map::Entry;
14 use std::collections::hash_map::{self, Entry};
15 use std::collections::HashMap;
15 use std::collections::HashMap;
16
16
17 // could be encapsulated if we care API stability more seriously
18 pub type DirsMultisetIter<'a> = hash_map::Keys<'a, Vec<u8>, u32>;
19
17 #[derive(PartialEq, Debug)]
20 #[derive(PartialEq, Debug)]
18 pub struct DirsMultiset {
21 pub struct DirsMultiset {
19 inner: HashMap<Vec<u8>, u32>,
22 inner: HashMap<Vec<u8>, u32>,
@@ -105,7 +108,7 b' impl DirsMultiset {'
105 self.inner.contains_key(key)
108 self.inner.contains_key(key)
106 }
109 }
107
110
108 pub fn iter(&self) -> impl Iterator<Item = &Vec<u8>> {
111 pub fn iter(&self) -> DirsMultisetIter {
109 self.inner.keys()
112 self.inner.keys()
110 }
113 }
111
114
@@ -9,7 +9,7 b' mod dirstate;'
9 pub mod discovery;
9 pub mod discovery;
10 pub mod testing; // unconditionally built, for use from integration tests
10 pub mod testing; // unconditionally built, for use from integration tests
11 pub use dirstate::{
11 pub use dirstate::{
12 dirs_multiset::DirsMultiset,
12 dirs_multiset::{DirsMultiset, DirsMultisetIter},
13 dirstate_map::DirstateMap,
13 dirstate_map::DirstateMap,
14 parsers::{pack_dirstate, parse_dirstate, PARENT_SIZE},
14 parsers::{pack_dirstate, parse_dirstate, PARENT_SIZE},
15 CopyMap, DirstateEntry, DirstateParents, EntryState, StateMap,
15 CopyMap, DirstateEntry, DirstateParents, EntryState, StateMap,
General Comments 0
You need to be logged in to leave comments. Login now