diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 344eab5..78772c4 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -125,7 +125,7 @@ jobs: - name: Get Changelog Entry if: startsWith(github.ref, 'refs/tags/') id: changelog_reader - uses: mindsers/changelog-reader-action@v2.2.3 + uses: mindsers/changelog-reader-action@v2.3.0 with: version: v${{ env.PROJECT_VERSION }} path: ./CHANGELOG.md diff --git a/Cargo.lock b/Cargo.lock index f356594..df63141 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1345,26 +1345,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "tailcall" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6be08989072ee5adeece48612b4f43ecf8ffce901dee274c33f7310c89f18de" -dependencies = [ - "tailcall-impl", -] - -[[package]] -name = "tailcall-impl" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44f72925e9aaaefcfbef1cf809d408e8a80bdb644ebe9fff0b94714d1d2d8e4d" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "thiserror" version = "1.0.69" @@ -1450,7 +1430,6 @@ dependencies = [ "regex", "rodio", "signal-hook 0.4.4", - "tailcall", "time", ] diff --git a/Cargo.toml b/Cargo.toml index cb974b7..373b890 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,6 @@ glob = "0.3" regex = "1.10" rodio = { version = "0.22", features = ["vorbis"] } signal-hook = "0.4" -tailcall = "2.0" time = { version = "0.3", features = ["formatting", "local-offset", "parsing"] } # beep libc = "0.2" diff --git a/src/timer.rs b/src/timer.rs index fe197bb..3aff99c 100644 --- a/src/timer.rs +++ b/src/timer.rs @@ -10,7 +10,6 @@ use std::thread::sleep; use std::time::Duration as stdDuration; use regex::{Regex, RegexSet}; -use tailcall::tailcall; use time::{Duration, OffsetDateTime, Time, format_description}; pub const BELL_CHART: char = ''; @@ -104,26 +103,25 @@ where } } -#[tailcall] pub fn countdown(w: &mut W, end: OffsetDateTime, opts: &Opts) -> Result<()> where W: io::Write, { - match end - OffsetDateTime::now_utc() { - counter if counter > Duration::ZERO => match ui::draw(w, counter) { - Ok(_) => { - sleep(stdDuration::from_secs(1)); - countdown(w, end, opts) - } - Err(e) => Err(e), - }, - _ => match ui::draw(w, Duration::ZERO) { - Ok(_) => { + loop { + match end - OffsetDateTime::now_utc() { + counter if counter > Duration::ZERO => match ui::draw(w, counter) { + Ok(_) => { + sleep(stdDuration::from_secs(1)); + } + Err(e) => return Err(e), + }, + _ => { + ui::draw(w, Duration::ZERO)?; + if opts.terminal_bell { println!("{BELL_CHART}"); } - let mut result = Ok(()); if !opts.silence { match Sound::new() { Ok(sound) => { @@ -140,13 +138,12 @@ where sleep(stdDuration::from_millis(BEEP_DELAY)); } } - Err(e) => result = Err(e), + Err(e) => return Err(e), } } - result + return Ok(()); } - Err(e) => Err(e), - }, + } } }