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

Method list_files

atomic-core/src/output/memory.rs:410–417  ·  view source on GitHub ↗

List all files (not directories) in the working copy. # Example ```rust use atomic_core::output::Memory; let wc = Memory::new(); wc.add_file("a.txt", b""); wc.add_file("b.txt", b""); let files = wc.list_files(); assert_eq!(files.len(), 2); ```

(&self)

Source from the content-addressed store, hash-verified

408 /// assert_eq!(files.len(), 2);
409 /// ```
410 pub fn list_files(&self) -> Vec<String> {
411 let files = self.files.borrow();
412 files
413 .iter()
414 .filter(|(_, f)| !f.metadata.is_dir)
415 .map(|(p, _)| p.clone())
416 .collect()
417 }
418
419 /// List all paths (files and directories) in the working copy.
420 pub fn list_all_paths(&self) -> Vec<String> {

Callers 1

test_list_filesFunction · 0.80

Calls 2

iterMethod · 0.45
cloneMethod · 0.45

Tested by 1

test_list_filesFunction · 0.64