derive some defaults to make clippy happy

This commit is contained in:
Abraham Toriz 2023-03-14 16:04:57 -05:00
parent 22d16ff5ba
commit 08ff8254d1
No known key found for this signature in database
GPG Key ID: D5B4A746DB5DD42A
3 changed files with 6 additions and 19 deletions

View File

@ -29,18 +29,14 @@ fn beginning_of_previous_month(time: DateTime<Local>) -> DateTime<Utc> {
}
}
#[derive(Default)]
enum MonthSpec {
Last,
#[default]
This,
Month(u32),
}
impl Default for MonthSpec {
fn default() -> MonthSpec {
MonthSpec::This
}
}
impl FromStr for MonthSpec {
type Err = Error;

View File

@ -12,18 +12,14 @@ use crate::io::Streams;
use crate::interactive::note_from_last_entries;
use super::{Command, Facts, r#in, sheet};
#[derive(Default)]
enum SelectedEntry {
Id(u64),
Interactive,
#[default]
NotSpecified,
}
impl Default for SelectedEntry {
fn default() -> Self {
SelectedEntry::NotSpecified
}
}
#[derive(Default)]
pub struct Args {
entry: SelectedEntry,

View File

@ -15,9 +15,10 @@ pub mod ical;
pub mod custom;
pub mod chart;
#[derive(Debug, Clone, Serialize, Deserialize)]
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")]
pub enum Formatter {
#[default]
Text,
Csv,
Json,
@ -27,12 +28,6 @@ pub enum Formatter {
Custom(String),
}
impl Default for Formatter {
fn default() -> Formatter {
Formatter::Text
}
}
impl Formatter {
/// Prints the given entries to the specified output device.
///