MCPcopy Create free account
hub / github.com/LaBatata101/sith-language-server / into_result

Method into_result

crates/sith_python_parser/src/lib.rs:284–290  ·  view source on GitHub ↗

Consumes the [`Parsed`] output and returns a [`Result`] which is [`Ok`] if it has no syntax errors, or [`Err`] containing the first [`ParseError`] encountered.

(self)

Source from the content-addressed store, hash-verified

282 /// Consumes the [`Parsed`] output and returns a [`Result`] which is [`Ok`] if it has no syntax
283 /// errors, or [`Err`] containing the first [`ParseError`] encountered.
284 pub(crate) fn into_result(self) -> Result<Parsed<T>, ParseError> {
285 if self.is_valid() {
286 Ok(self)
287 } else {
288 Err(self.into_errors().into_iter().next().unwrap())
289 }
290 }
291}
292
293impl Parsed<Mod> {

Callers 3

parse_expressionFunction · 0.80
parse_expression_rangeFunction · 0.80
parseFunction · 0.80

Calls 4

into_errorsMethod · 0.80
is_validMethod · 0.45
nextMethod · 0.45
into_iterMethod · 0.45

Tested by

no test coverage detected