From d28b6fb06404575e37f65bdf7bf73e7a993c42b9 Mon Sep 17 00:00:00 2001 From: Omnikar Date: Sun, 5 Dec 2021 20:28:09 -0500 Subject: [PATCH] Use `anyhow::ensure` --- helix-term/src/commands.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 407609f7c..57dd9716b 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -2649,9 +2649,7 @@ mod cmd { path.push("help"); path.push(format!("{}.txt", command)); - if !path.is_file() { - bail!("No help available for '{}'", args.join(" ")); - } + ensure!(path.is_file(), "No help available for '{}'", args.join(" ")); let id = cx.editor.open(path, Action::HorizontalSplit)?; cx.editor.document_mut(id).unwrap().set_path(None)?;