From 0c080ab401657f370c277337483525d2870c9759 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Sun, 19 Jul 2020 22:49:41 +0200 Subject: [PATCH] Show error message if an item could not be found With the introduction of the search index, I mistakenly removed the error message for missing items. This patch fixes that. --- src/main.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index f929c58..67f087a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -140,7 +140,10 @@ fn search_item( items.dedup(); if items.is_empty() { - Ok(None) + Err(anyhow::anyhow!( + "Could not find documentation for {}", + &keyword + )) } else if items.len() == 1 { Ok(Some(items[0].clone())) } else {