Show More
@@ -57,4 +57,17 b' impl ManifestEntry {' | |||
|
57 | 57 | HgPath::new(&line[..pos]) |
|
58 | 58 | }) |
|
59 | 59 | } |
|
60 | ||
|
61 | /// Return an iterator over the files of the entry. | |
|
62 | pub fn files_with_nodes(&self) -> impl Iterator<Item = (&HgPath, &[u8])> { | |
|
63 | self.lines().filter(|line| !line.is_empty()).map(|line| { | |
|
64 | let pos = line | |
|
65 | .iter() | |
|
66 | .position(|x| x == &b'\0') | |
|
67 | .expect("manifest line should contain \\0"); | |
|
68 | let hash_start = pos + 1; | |
|
69 | let hash_end = hash_start + 40; | |
|
70 | (HgPath::new(&line[..pos]), &line[hash_start..hash_end]) | |
|
71 | }) | |
|
72 | } | |
|
60 | 73 | } |
General Comments 0
You need to be logged in to leave comments.
Login now