MCPcopy Index your code
hub / github.com/HairlessVillager/minecommit / flatten

Method flatten

minecommit/src/handler/raw.rs:24–37  ·  view source on GitHub ↗
(self, save: &impl OdbReader, storage: &mut impl OdbWriter)

Source from the content-addressed store, hash-verified

22 }
23
24 fn flatten(self, save: &impl OdbReader, storage: &mut impl OdbWriter) -> Result<Vec<String>> {
25 let mut processed = Vec::new();
26 let builtin = RAW_GLOB_PATTERNS.iter().copied();
27 let extra = self.extra_patterns.iter().map(|s| s.as_str());
28 for pattern in builtin.chain(extra) {
29 for key in save.glob(pattern)? {
30 log::info!("Process raw file {key}");
31 let data = save.get(&key)?;
32 storage.put(&key, &data)?;
33 processed.push(key);
34 }
35 }
36 Ok(processed)
37 }
38
39 fn unflatten(self, save: &mut impl OdbWriter, storage: &impl OdbReader) -> Result<Vec<String>> {
40 let mut processed = Vec::new();

Callers

nothing calls this directly

Calls 3

globMethod · 0.45
getMethod · 0.45
putMethod · 0.45

Tested by

no test coverage detected