Use color_eyre (#173)

This commit is contained in:
Rebecca Turner
2022-11-11 09:39:29 -05:00
committed by Thomas Schönauer
parent e84173be8f
commit 2cbb7db66d
34 changed files with 216 additions and 72 deletions

View File

@@ -3,7 +3,8 @@ use std::ffi::{OsStr, OsString};
use std::path::Path;
use std::process::{Child, Command, ExitStatus, Output};
use anyhow::Result;
use color_eyre::eyre;
use color_eyre::eyre::Result;
use log::debug;
use crate::command::CommandExt;
@@ -240,7 +241,7 @@ impl CommandExt for Executor {
// TODO: It might be nice to make `output_checked_with` return something that has a
// variant for wet/dry runs.
fn output_checked_with(&mut self, succeeded: impl Fn(&Output) -> Result<(), ()>) -> anyhow::Result<Output> {
fn output_checked_with(&mut self, succeeded: impl Fn(&Output) -> Result<(), ()>) -> eyre::Result<Output> {
match self {
Executor::Wet(c) => c.output_checked_with(succeeded),
Executor::Dry(c) => {
@@ -250,7 +251,7 @@ impl CommandExt for Executor {
}
}
fn status_checked_with(&mut self, succeeded: impl Fn(ExitStatus) -> Result<(), ()>) -> anyhow::Result<()> {
fn status_checked_with(&mut self, succeeded: impl Fn(ExitStatus) -> Result<(), ()>) -> eyre::Result<()> {
match self {
Executor::Wet(c) => c.status_checked_with(succeeded),
Executor::Dry(c) => {
@@ -260,7 +261,7 @@ impl CommandExt for Executor {
}
}
fn spawn_checked(&mut self) -> anyhow::Result<Self::Child> {
fn spawn_checked(&mut self) -> eyre::Result<Self::Child> {
self.spawn()
}
}