From 5e040d65306d518cbabd92299a48fd441d8ad17c Mon Sep 17 00:00:00 2001 From: Awiteb Date: Wed, 25 Dec 2024 11:33:04 +0000 Subject: [PATCH] chore: Method to return new renaming name of `Mode` if any Signed-off-by: Awiteb --- src/view/mode.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/view/mode.rs b/src/view/mode.rs index 05e97be..3ae9c62 100644 --- a/src/view/mode.rs +++ b/src/view/mode.rs @@ -9,3 +9,13 @@ pub enum Mode { /// TODO Rename(String), } + +impl Mode { + /// TODO + pub fn new_name(&self) -> Option<&str> { + match &self { + Mode::Rename(new_name) => Some(new_name), + _ => None, + } + } +}