From 833669af3c4349dd79646133f165d365562edd93 Mon Sep 17 00:00:00 2001 From: Lux Aliaga Date: Mon, 7 Nov 2022 18:18:25 -0300 Subject: [PATCH] item: Add slot to take/drop messages To be more consistent with undo messages, I've added the slot in which items are involved to take and drop messages. Simple as that. --- src/item.rs | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/src/item.rs b/src/item.rs index 9a94f74..d997354 100644 --- a/src/item.rs +++ b/src/item.rs @@ -90,10 +90,19 @@ pub fn take(file: &String, slot: &str, message: bool) -> Result<()> { if message { println!( - "✅ {} {} {} ", + "✅ {} {} {} {} {} {} {}", "Took".green(), &filename.bold(), - format!("from {}", &sourcelocation.to_str().unwrap()).green() + "from".green(), + &sourcelocation.to_str().unwrap(), + "to".green(), + match slot { + "active" => slot.green(), + "inactive" => slot.blue(), + _ => slot.red(), + } + .bold(), + "slot".green() ); } @@ -168,10 +177,18 @@ pub fn drop(file: &String, slot: &str, dest: PathBuf, message: bool) -> Result<( if message { println!( - "✅ {} {} {} ", + "✅ {} {} {} {} {} {}", "Dropped".green(), &file.bold(), - format!("into {}", &destpath.to_str().unwrap()).green() + "from".green(), + match slot { + "active" => slot.green(), + "inactive" => slot.blue(), + _ => slot.red(), + } + .bold(), + "slot into".green(), + &destpath.to_str().unwrap() ); };