diff --git a/Cargo.lock b/Cargo.lock index a9eeb76..4f58e4c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6,15 +6,6 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2692800d602527d2b8fea50036119c37df74ab565b10e285706a3dcec0ec3e16" -[[package]] -name = "addr2line" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b6a2d3371669ab3ca9797670853d61402b03d0b4b9ebf33d677dfa720203072" -dependencies = [ - "gimli", -] - [[package]] name = "adler" version = "0.2.3" @@ -36,6 +27,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "anyhow" +version = "1.0.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b602bfe940d21c130f3895acd65221e8a61270debe89d628b9cb4e3ccb8569b" + [[package]] name = "arrayref" version = "0.3.6" @@ -65,20 +62,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" -[[package]] -name = "backtrace" -version = "0.3.50" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46254cf2fdcdf1badb5934448c1bcbe046a56537b3987d96c51a7afc5d03f293" -dependencies = [ - "addr2line", - "cfg-if", - "libc", - "miniz_oxide 0.4.2", - "object", - "rustc-demangle", -] - [[package]] name = "base64" version = "0.12.3" @@ -464,28 +447,6 @@ dependencies = [ "pkg-config", ] -[[package]] -name = "failure" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86" -dependencies = [ - "backtrace", - "failure_derive", -] - -[[package]] -name = "failure_derive" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" -dependencies = [ - "proc-macro2 1.0.21", - "quote 1.0.7", - "syn 1.0.41", - "synstructure", -] - [[package]] name = "flate2" version = "1.0.17" @@ -582,12 +543,6 @@ dependencies = [ "wasi", ] -[[package]] -name = "gimli" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaf91faf136cb47367fa430cd46e37a788775e7fa104f8b4bcb3861dc389b724" - [[package]] name = "hashbrown" version = "0.9.0" @@ -902,12 +857,6 @@ dependencies = [ "objc", ] -[[package]] -name = "object" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ab52be62400ca80aa00285d25253d7f7c437b7375c4de678f5405d3afe82ca5" - [[package]] name = "onig" version = "6.1.0" @@ -1208,12 +1157,6 @@ dependencies = [ "crossbeam-utils", ] -[[package]] -name = "rustc-demangle" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" - [[package]] name = "rustc_version" version = "0.2.3" @@ -1328,11 +1271,11 @@ dependencies = [ name = "silicon" version = "0.3.2" dependencies = [ + "anyhow", "clipboard", "clipboard-win 4.0.3", "conv", "env_logger", - "failure", "font-kit", "image", "imageproc", @@ -1424,18 +1367,6 @@ dependencies = [ "unicode-xid 0.2.1", ] -[[package]] -name = "synstructure" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b834f2d66f734cb897113e34aaff2f1ab4719ca946f9a7358dba8f8064148701" -dependencies = [ - "proc-macro2 1.0.21", - "quote 1.0.7", - "syn 1.0.41", - "unicode-xid 0.2.1", -] - [[package]] name = "syntect" version = "4.4.0" diff --git a/Cargo.toml b/Cargo.toml index 8fd6afd..161e7f8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,8 +43,8 @@ version = "4.4" default-features = false features = ["parsing", "dump-load", "regex-onig"] -[dependencies.failure] -version = "0.1.8" +[dependencies.anyhow] +version = "1.0" optional = true [dependencies.structopt] @@ -61,4 +61,4 @@ optional = true [features] default = ["bin"] -bin = ["structopt", "env_logger", "failure"] +bin = ["structopt", "env_logger", "anyhow"] diff --git a/src/bin.rs b/src/bin.rs index f530edb..8ff2559 100644 --- a/src/bin.rs +++ b/src/bin.rs @@ -1,11 +1,11 @@ #[macro_use] extern crate log; #[macro_use] -extern crate failure; +extern crate anyhow; use crate::config::Config; use crate::utils::*; -use failure::Error; +use anyhow::Error; use image::DynamicImage; use structopt::StructOpt; use syntect::easy::HighlightLines; diff --git a/src/config.rs b/src/config.rs index d700df0..55ac0ee 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,7 +1,7 @@ use crate::formatter::{ImageFormatter, ImageFormatterBuilder}; use crate::utils::{ShadowAdder, ToRgba}; use clipboard::{ClipboardContext, ClipboardProvider}; -use failure::Error; +use anyhow::Error; use image::Rgba; use std::fs::File; use std::io::{stdin, Read};