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

Method parse_algorithm

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

Parse the algorithm string into an Algorithm enum.

(&self)

Source from the content-addressed store, hash-verified

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

Calls 1

as_strMethod · 0.45