Use `anyhow::ensure`

pull/997/head
Omnikar 3 years ago
parent d48c555c3d
commit d28b6fb064
No known key found for this signature in database
GPG Key ID: 7DE6694CDA7885ED

@ -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)?;

Loading…
Cancel
Save