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

Method read

atomic-repository/src/worktree_presence.rs:95–107  ·  view source on GitHub ↗
(directory: &Path)

Source from the content-addressed store, hash-verified

93
94impl DirectoryListing {
95 fn read(directory: &Path) -> io::Result<Self> {
96 let mut listing = Self::default();
97 for entry in fs::read_dir(directory)? {
98 let name = entry?.file_name();
99 if let Some(text) = name.to_str() {
100 if !is_nfc(text) {
101 listing.composed.insert(text.nfc().collect(), name.clone());
102 }
103 }
104 listing.names.insert(name);
105 }
106 Ok(listing)
107 }
108
109 /// The on-disk spelling of `name`: the same bytes, or the entry whose
110 /// composed form equals `name`'s composed form.

Callers

nothing calls this directly

Calls 4

file_nameMethod · 0.45
insertMethod · 0.45
collectMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected