Parse the algorithm string into an Algorithm enum.
(&self)
| 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> { |