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

Method parse_algorithm

atomic-cli/src/commands/record/builder.rs:34–45  ·  view source on GitHub ↗

Parse the algorithm string into an Algorithm enum.

(&self)

Source from the content-addressed store, hash-verified

32
33 /// Parse the algorithm string into an Algorithm enum.
34 pub(super) fn parse_algorithm(&self) -> CliResult<Algorithm> {
35 match self.algorithm.to_lowercase().as_str() {
36 "myers" => Ok(Algorithm::Myers),
37 "patience" => Ok(Algorithm::Patience),
38 other => Err(CliError::InvalidArgument {
39 message: format!(
40 "Invalid algorithm '{}'. Expected 'myers' or 'patience'.",
41 other
42 ),
43 }),
44 }
45 }
46
47 /// Parse the author string into an Author struct.
48 pub(crate) fn parse_author(&self) -> Option<Author> {

Calls 1

as_strMethod · 0.45