diff --git a/Cargo.lock b/Cargo.lock index 67d90e2..3d0d136 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -75,12 +75,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "anyhow" -version = "1.0.79" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" - [[package]] name = "autocfg" version = "1.1.0" @@ -98,7 +92,6 @@ name = "carl" version = "0.3.1" dependencies = [ "anstyle", - "anyhow", "chrono", "clap", "icalendar", diff --git a/Cargo.toml b/Cargo.toml index c18426c..e580dfc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,6 @@ keywords = ["calendar", "ical", "cli", "date", "cal"] categories = ["command-line-utilities", "date-and-time"] [dependencies] -anyhow = "1.0" chrono = { version = "0.4", default-features = false, features = ["clock"] } clap = { version = "4.4.18", features = ["derive", "cargo"] } toml = "0.8.*" diff --git a/src/cli.rs b/src/cli.rs index 3485d16..f21ccd1 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -2,7 +2,6 @@ // // SPDX-License-Identifier: MIT -use anyhow::{anyhow, Result}; use chrono::prelude::*; use clap::{crate_authors, crate_name, crate_version, Args, Parser}; @@ -66,7 +65,7 @@ pub struct Action { } impl Cli { - pub fn validate_date(&self) -> Result { + pub fn validate_date(&self) -> Result { let mut today: chrono::NaiveDate = Local::now().date_naive(); let mut year: i32 = today.year(); let mut month: u32 = today.month(); @@ -76,7 +75,7 @@ impl Cli { year = match self.date[0].parse() { Ok(x) => { if x > 9999 { - return Err(anyhow!( + return Err(format!( "{}: illegal year value: use 1-9999: {}", crate_name!(), x @@ -85,7 +84,7 @@ impl Cli { x } Err(x) => { - return Err(anyhow!( + return Err(format!( "{}: illegal year value: use 1-9999: {}", crate_name!(), x @@ -97,7 +96,7 @@ impl Cli { month = match self.date[1].parse() { Ok(x) => { if x > 12 { - return Err(anyhow!( + return Err(format!( "{}: illegal month value: use 1-12: {}", crate_name!(), x @@ -106,7 +105,7 @@ impl Cli { x } Err(x) => { - return Err(anyhow!( + return Err(format!( "{}: illegal month value: use 1-12: {}", crate_name!(), x @@ -119,7 +118,7 @@ impl Cli { day = match self.date[2].parse() { Ok(x) => { if x > 31 { - return Err(anyhow!( + return Err(format!( "{}: illegal day value: use 1-12: {}", crate_name!(), x @@ -128,7 +127,7 @@ impl Cli { x } Err(x) => { - return Err(anyhow!( + return Err(format!( "{}: illegal day value: use 1-12: {}", crate_name!(), x diff --git a/src/context.rs b/src/context.rs index c768de6..52e42e1 100644 --- a/src/context.rs +++ b/src/context.rs @@ -6,7 +6,6 @@ use crate::cli::{Action, Cli}; use crate::config::StyleType; use crate::config::{Config, Theme}; use crate::events::EventInstances; -use anyhow::Result; use chrono::prelude::*; use clap::Parser; @@ -21,7 +20,7 @@ pub struct Context { } impl Context { - pub fn new() -> Result { + pub fn new() -> Result { let mut opts: Cli = Cli::parse(); let config: Config = Config::read(); let theme: Theme = if opts.theme.is_some() {