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.
This commit is contained in:
Robin Krahl 2020-07-19 22:49:41 +02:00
parent bd71f41458
commit 0c080ab401
No known key found for this signature in database
GPG Key ID: 8E9B0870524F69D8

View File

@ -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 {