chore: address clippy findings
cargo devel CI / cargo CI (push) Has been cancelled Details

This commit is contained in:
Christoph J. Scherr 2024-07-26 10:51:22 +02:00
parent 0853ee103b
commit 671810a834
2 changed files with 8 additions and 0 deletions

View File

@ -1,5 +1,10 @@
#![warn(clippy::pedantic, clippy::style, clippy::nursery)]
// That's useful and sometimes I don't need extra stuff
#![allow(clippy::question_mark_used)]
// allows us to cast u64 to i64, if the number is too high
// enough time has passed that I don't care
#![allow(clippy::cast_possible_wrap)]
#![allow(clippy::cast_sign_loss)] // it should only be positive anyway
use chrono::{DateTime, Local, SubsecRound, Timelike};
use clap::Parser;
@ -257,6 +262,7 @@ impl Clock {
fn on_tick(&mut self) {
self.maybe_reset_since_zero();
}
#[allow(clippy::cast_possible_truncation)] // if we have that much padding, please truncate
fn ui(
&mut self,
terminal: &mut Terminal<CrosstermBackend<Stdout>>,

View File

@ -61,6 +61,8 @@ impl Data {
#[must_use]
#[inline]
#[allow(clippy::missing_const_for_fn)] // why should it be okay to make this const? This is
// a custom ringbuffer!
pub fn now(&self) -> &DateTime<Local> {
&self.now[self.idx]
}