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

Method parse_algorithm

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

Parse the algorithm string into an Algorithm enum.

(&self)

Source from the content-addressed store, hash-verified

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

Calls 1

as_strMethod · 0.45