Stop using eyre even in examples

This commit is contained in:
Félix Saparelli 2021-10-10 21:04:40 +13:00
parent 7af0339871
commit 59fe74656a
No known key found for this signature in database
GPG Key ID: B948C4BAE44FC474
6 changed files with 12 additions and 73 deletions

62
Cargo.lock generated
View File

@ -302,33 +302,6 @@ dependencies = [
"winapi",
]
[[package]]
name = "color-eyre"
version = "0.5.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1f1885697ee8a177096d42f158922251a41973117f6d8a234cee94b9509157b7"
dependencies = [
"backtrace",
"color-spantrace",
"eyre",
"indenter",
"once_cell",
"owo-colors 1.3.0",
"tracing-error",
]
[[package]]
name = "color-spantrace"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6eee477a4a8a72f4addd4de416eb56d54bc307b284d6601bafdee1f4ea462d1"
dependencies = [
"once_cell",
"owo-colors 1.3.0",
"tracing-core",
"tracing-error",
]
[[package]]
name = "command-group"
version = "1.0.6"
@ -541,16 +514,6 @@ dependencies = [
"syn 1.0.77",
]
[[package]]
name = "eyre"
version = "0.6.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "221239d1d5ea86bf5d6f91c9d6bc3646ffe471b08ff9b0f91c44f115ac969d2b"
dependencies = [
"indenter",
"once_cell",
]
[[package]]
name = "fastrand"
version = "1.5.0"
@ -929,12 +892,6 @@ dependencies = [
"unicode-normalization",
]
[[package]]
name = "indenter"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683"
[[package]]
name = "indexmap"
version = "1.7.0"
@ -1189,7 +1146,7 @@ dependencies = [
"backtrace",
"miette-derive",
"once_cell",
"owo-colors 2.1.0",
"owo-colors",
"supports-color",
"supports-hyperlinks",
"supports-unicode",
@ -1456,12 +1413,6 @@ dependencies = [
"vcpkg",
]
[[package]]
name = "owo-colors"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2386b4ebe91c2f7f51082d4cefa145d030e33a1842a96b12e4885cc3c01f7a55"
[[package]]
name = "owo-colors"
version = "2.1.0"
@ -2461,16 +2412,6 @@ dependencies = [
"lazy_static",
]
[[package]]
name = "tracing-error"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b4d7c0b83d4a500748fa5879461652b361edf5c9d51ede2a2ac03875ca185e24"
dependencies = [
"tracing",
"tracing-subscriber",
]
[[package]]
name = "tracing-futures"
version = "0.2.5"
@ -2705,7 +2646,6 @@ dependencies = [
"async-stream",
"atomic-take",
"clearscreen",
"color-eyre",
"command-group",
"dunce",
"futures",

View File

@ -41,5 +41,4 @@ version = "1.10.0"
features = ["full"]
[dev-dependencies]
color-eyre = "0.5.11"
tracing-subscriber = "0.2.19"

View File

@ -1,5 +1,6 @@
use std::time::Duration;
use miette::{IntoDiagnostic, Result};
use watchexec::{
action::{Action, Outcome},
config::{InitConfig, RuntimeConfig},
@ -11,9 +12,8 @@ use watchexec::{
// Run with: `env RUST_LOG=debug cargo run --example print_out`
#[tokio::main]
async fn main() -> color_eyre::eyre::Result<()> {
async fn main() -> Result<()> {
tracing_subscriber::fmt::init();
color_eyre::install()?;
let mut init = InitConfig::default();
init.on_error(|err| async move {
@ -65,7 +65,7 @@ async fn main() -> color_eyre::eyre::Result<()> {
});
wx.reconfigure(runtime)?;
wx.main().await??;
wx.main().await.into_diagnostic()??;
Ok(())
}

View File

@ -1,5 +1,6 @@
use std::time::Duration;
use miette::{IntoDiagnostic, Result};
use tokio::{
sync::{mpsc, watch},
time::sleep,
@ -9,9 +10,8 @@ use watchexec::{event::Event, fs};
// Run with: `env RUST_LOG=debug cargo run --example fs`,
// then touch some files within the first 15 seconds, and afterwards.
#[tokio::main]
async fn main() -> color_eyre::eyre::Result<()> {
async fn main() -> Result<()> {
tracing_subscriber::fmt::init();
color_eyre::install()?;
let (ev_s, mut ev_r) = mpsc::channel::<Event>(1024);
let (er_s, mut er_r) = mpsc::channel(64);
@ -19,7 +19,7 @@ async fn main() -> color_eyre::eyre::Result<()> {
let mut wkd = fs::WorkingData::default();
wkd.pathset = vec![".".into()];
wd_s.send(wkd.clone())?;
wd_s.send(wkd.clone()).into_diagnostic()?;
tokio::spawn(async move {
while let Some(e) = ev_r.recv().await {
@ -42,7 +42,7 @@ async fn main() -> color_eyre::eyre::Result<()> {
});
fs::worker(wd_r, er_s, ev_s).await?;
wd_sh.await?;
wd_sh.await.into_diagnostic()?;
Ok(())
}

View File

@ -1,5 +1,6 @@
use std::process::exit;
use miette::Result;
use tokio::sync::mpsc;
use watchexec::{
event::{Event, Tag},
@ -10,9 +11,8 @@ use watchexec::{
// then issue some signals to the printed PID, or hit e.g. Ctrl-C.
// Send a SIGTERM (unix) or Ctrl-Break (windows) to exit.
#[tokio::main]
async fn main() -> color_eyre::eyre::Result<()> {
async fn main() -> Result<()> {
tracing_subscriber::fmt::init();
color_eyre::install()?;
let (ev_s, mut ev_r) = mpsc::channel::<Event>(1024);
let (er_s, mut er_r) = mpsc::channel(64);

View File

@ -1,5 +1,6 @@
use std::time::Duration;
use miette::Result;
use tokio::time::sleep;
use watchexec::{
config::{InitConfig, RuntimeConfig},
@ -7,9 +8,8 @@ use watchexec::{
};
#[tokio::main]
async fn main() -> color_eyre::eyre::Result<()> {
async fn main() -> Result<()> {
tracing_subscriber::fmt::init();
color_eyre::install()?;
let mut init = InitConfig::default();
init.on_error(|err| async move {