Skip to content

Commit

Permalink
Replaced anyhow with color-eyre
Browse files Browse the repository at this point in the history
  • Loading branch information
Xithrius committed Jun 6, 2022
1 parent b3d9a85 commit be1c225
Show file tree
Hide file tree
Showing 4 changed files with 232 additions and 17 deletions.
219 changes: 215 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
[package]
name = "rust-binary-project-template"
version = "0.1.0"
edition = "2018"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
serde = { version = "1.0.136", features = ["derive"] }
serde = { version = "1.0.136", features = [ "derive" ] }
toml = "0.5.8"
anyhow = "1.0.53"
color-eyre = "0.6.1"

[profile.dev.package.backtrace]
opt-level = 3

[[bin]]
bench = false
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/config.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use anyhow::{bail, Error, Result};
use color_eyre::eyre::{bail, Error, Result};
use serde::Deserialize;

use crate::utils::pathing::config_path;
Expand Down
19 changes: 10 additions & 9 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
use color_eyre::eyre::{Error, Result, WrapErr};

mod handlers;
mod utils;

use crate::handlers::config::CompleteConfig;

fn main() {
match CompleteConfig::new() {
Ok(_config) => {
println!("Hello World!");
}
Err(err) => {
println!("{}", err);
}
}
fn main() -> Result<(), Error> {
color_eyre::install().unwrap();

let mut _config = CompleteConfig::new()
.wrap_err("Unable to read configuration file.")
.unwrap();

Ok(())
}

0 comments on commit be1c225

Please sign in to comment.