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

Method path

atomic-core/src/change/format_v3/graph_fields/decode.rs:167–181  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

165 Ok(n)
166 }
167 fn path(&mut self) -> FormatResult<String> {
168 let id: usize = self.n(PATH)?;
169 let path = self
170 .dictionary
171 .get(id)
172 .ok_or_else(|| invalid("path dictionary index"))?;
173 if id > self.dictionary_end {
174 return Err(invalid("dictionary first-use gap"));
175 }
176 if id == self.dictionary_end {
177 self.dictionary_end += 1;
178 }
179 charge(&mut self.budget, path.len(), 1)?;
180 owned(path)
181 }
182 fn local(&mut self, role: usize) -> FormatResult<Local> {
183 Ok(Local {
184 path: self.path()?,

Callers 2

localMethod · 0.45
opMethod · 0.45

Calls 6

invalidFunction · 0.70
chargeFunction · 0.70
ownedFunction · 0.70
getMethod · 0.65
nMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected