MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / next

Method next

atomic-repository/src/changestore/iterators.rs:79–102  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

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// ═══════════════════════════════════════════════════════════════════════

Callers 1

next_from_filesMethod · 0.45

Calls 3

next_from_filesMethod · 0.80
is_dirMethod · 0.80
pathMethod · 0.45

Tested by

no test coverage detected