Get the message for the revised change.
(&self, original_message: &str)
| 355 | |
| 356 | /// Get the message for the revised change. |
| 357 | fn get_message(&self, original_message: &str) -> CliResult<String> { |
| 358 | // If explicit message provided, use it |
| 359 | if let Some(ref msg) = self.message { |
| 360 | return Ok(msg.clone()); |
| 361 | } |
| 362 | |
| 363 | // If reword mode and not no-edit, open editor |
| 364 | if self.reword && !self.no_edit { |
| 365 | return self.get_message_from_editor(original_message); |
| 366 | } |
| 367 | |
| 368 | // Otherwise use original message |
| 369 | Ok(original_message.to_string()) |
| 370 | } |
| 371 | |
| 372 | /// Open an editor for the user to edit the message. |
| 373 | fn get_message_from_editor(&self, original_message: &str) -> CliResult<String> { |