MCPcopy Create free account
hub / github.com/FuzzAnything/PromptFuzz / parse_vec

Method parse_vec

src/program/serde.rs:196–211  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

194 }
195
196 pub fn parse_vec<T: Deserialize>(&mut self) -> Result<Vec<T>> {
197 let mut v = Vec::new();
198 if self.next_char()? != '[' {
199 return Err(eyre::eyre!("Seserializer error: expect a `[`."));
200 }
201 loop {
202 let item = T::deserialize(self)?;
203 v.push(item);
204 if self.peek_char()? == ']' {
205 break;
206 }
207 self.eat_token(",")?;
208 }
209 self.eat_token("]")?;
210 Ok(v)
211 }
212
213 pub fn parse_path(&mut self) -> Result<PathBuf> {
214 let path = self.consume_token_until("\n")?;

Callers

nothing calls this directly

Calls 4

next_charMethod · 0.80
peek_charMethod · 0.80
eat_tokenMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected