From f144426bf5f5ddbe4755b4e437373dce4dc6ecb2 Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Mon, 5 Oct 2020 20:54:15 +0200 Subject: [PATCH] use 'unreachable' instead of 'panic' --- examples/repl/cmdline.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/repl/cmdline.rs b/examples/repl/cmdline.rs index 0fd2dad4b..e949a34e2 100644 --- a/examples/repl/cmdline.rs +++ b/examples/repl/cmdline.rs @@ -915,7 +915,7 @@ pub async fn cmdline(context: Context, line: &str, chat_id: &mut ChatId) -> Resu "archive" => ChatVisibility::Archived, "unarchive" | "unpin" => ChatVisibility::Normal, "pin" => ChatVisibility::Pinned, - _ => panic!("Unexpected command (This should never happen)"), + _ => unreachable!("arg0={:?}", arg0), }, ) .await?; @@ -929,7 +929,7 @@ pub async fn cmdline(context: Context, line: &str, chat_id: &mut ChatId) -> Resu match arg0 { "protect" => ProtectionStatus::Protected, "unprotect" => ProtectionStatus::Unprotected, - _ => panic!("Unexpected command (This should never happen)"), + _ => unreachable!("arg0={:?}", arg0), }, ) .await?;