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

Method parse_string

src/program/serde.rs:162–174  ·  view source on GitHub ↗

Parse a string until the next '"' character.

(&mut self)

Source from the content-addressed store, hash-verified

160
161 // Parse a string until the next '"' character.
162 pub fn parse_string(&mut self) -> Result<&'de str> {
163 if self.next_char()? != '"' {
164 return Err(eyre::eyre!("expect a string: {}.", self.input));
165 }
166 match self.input.find('"') {
167 Some(len) => {
168 let s = &self.input[..len];
169 self.input = &self.input[len + 1..];
170 Ok(s)
171 }
172 None => Err(eyre::eyre!("parsing until end of input: {}", self.input)),
173 }
174 }
175
176 pub fn parse_number<T: FromStr>(&mut self) -> eyre::Result<T> {
177 let mut len = 0;

Callers 1

deserializeMethod · 0.80

Calls 1

next_charMethod · 0.80

Tested by

no test coverage detected