(&mut self)
| 77 | type Item = ChangeStoreResult<Hash>; |
| 78 | |
| 79 | fn next(&mut self) -> Option<Self::Item> { |
| 80 | loop { |
| 81 | // Try to get next from current file iterator |
| 82 | if let Some(result) = self.next_from_files() { |
| 83 | return Some(result); |
| 84 | } |
| 85 | |
| 86 | // Move to next subdirectory |
| 87 | let dir_iter = self.dir_iter.as_mut()?; |
| 88 | |
| 89 | loop { |
| 90 | match dir_iter.next()? { |
| 91 | Ok(entry) => { |
| 92 | let path = entry.path(); |
| 93 | if path.is_dir() { |
| 94 | self.file_iter = fs::read_dir(&path).ok(); |
| 95 | break; |
| 96 | } |
| 97 | } |
| 98 | Err(e) => return Some(Err(ChangeStoreError::Io(e))), |
| 99 | } |
| 100 | } |
| 101 | } |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | // ═══════════════════════════════════════════════════════════════════════ |
no test coverage detected