From 4ebf0681c2cc35010e8196ac4f245adb32b2be27 Mon Sep 17 00:00:00 2001 From: Abraham Toriz Date: Wed, 11 Aug 2021 20:35:24 -0500 Subject: [PATCH] collapse if block --- src/commands/archive.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/commands/archive.rs b/src/commands/archive.rs index 636b027..9d6c876 100644 --- a/src/commands/archive.rs +++ b/src/commands/archive.rs @@ -71,14 +71,12 @@ impl<'a> Command<'a> for ArchiveCommand { now, true, )?; - } else { - if ask(out, &format!("Archive {} entries?", entries.len()))? { - for entry in entries { - db.entry_update(entry.id, entry.start, entry.end, entry.note, &format!("_{}", entry.sheet))?; - } - } else { - writeln!(out, "Ok, they're still there")?; + } else if ask(out, &format!("Archive {} entries?", entries.len()))? { + for entry in entries { + db.entry_update(entry.id, entry.start, entry.end, entry.note, &format!("_{}", entry.sheet))?; } + } else { + writeln!(out, "Ok, they're still there")?; } Ok(())