Skip to content

Commit

Permalink
Derive Default for Method and FilterList
Browse files Browse the repository at this point in the history
  • Loading branch information
greyblake committed Aug 16, 2023
1 parent 7fb8b60 commit 7a3b93c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
9 changes: 2 additions & 7 deletions src/core/filter_list.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
use crate::Lang;

#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
#[derive(Debug, Clone)]
#[derive(Debug, Clone, Default)]
pub enum FilterList {
#[default]
All,
Allow(Vec<Lang>),
Deny(Vec<Lang>),
Expand Down Expand Up @@ -31,12 +32,6 @@ impl FilterList {
}
}

impl Default for FilterList {
fn default() -> Self {
FilterList::All
}
}

#[cfg(test)]
mod tests {
use super::*;
Expand Down
9 changes: 2 additions & 7 deletions src/core/method.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ use std::fmt;
use std::str::FromStr;

#[cfg_attr(feature = "arbitrary", derive(::arbitrary::Arbitrary))]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub enum Method {
Trigram,
Alphabet,
#[default]
Combined,
}

Expand Down Expand Up @@ -34,12 +35,6 @@ impl fmt::Display for Method {
}
}

impl Default for Method {
fn default() -> Self {
Method::Combined
}
}

#[cfg(test)]
mod tests {
use super::*;
Expand Down

0 comments on commit 7a3b93c

Please sign in to comment.