| 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()?, |