From d7a6259a7e66adbdee33a8b8033b4af4c9100ea5 Mon Sep 17 00:00:00 2001 From: Coin de Gamma Date: Fri, 20 Sep 2024 13:23:20 +0000 Subject: [PATCH] empty show --- src/main.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 4451f2e..a04939d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -142,9 +142,13 @@ impl MPS { fn list(&mut self) -> io:: Result<()> { self.login()?; - let st = self.storage.as_ref().unwrap(); - for id in st.ids() { - println!("{}", id); + let ids = self.storage.as_ref().unwrap().ids(); + if ids.len() == 0 { + println!("No items"); + } else { + for id in ids { + println!("{}", id); + } } Ok(()) }