core: switch to anyhow

This commit adds `anyhow` as a dependency and switches over to it from
Box<dyn Error>.

It actually looks like I've kept all of my errors rather shallow, such
that we don't get a huge benefit from anyhow at present. But now that
anyhow is in use, I expect to use its "context" feature more going
forward.
This commit is contained in:
Andrew Gallant
2023-10-12 12:16:42 -04:00
parent 53679e4c43
commit 92c81b1225
6 changed files with 105 additions and 104 deletions

View File

@@ -119,7 +119,7 @@ impl SearchWorkerBuilder {
pub fn preprocessor(
&mut self,
cmd: Option<PathBuf>,
) -> crate::Result<&mut SearchWorkerBuilder> {
) -> anyhow::Result<&mut SearchWorkerBuilder> {
if let Some(ref prog) = cmd {
let bin = cli::resolve_binary(prog)?;
self.config.preprocessor = Some(bin);