refactor: derive Default for Filter (clippy)
This commit is contained in:
+1
-7
@@ -34,7 +34,7 @@ pub struct Tags {
|
||||
pub exotic: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Debug, Clone, Default)]
|
||||
pub struct Filter {
|
||||
pub billable_only: bool,
|
||||
pub valid_only: bool,
|
||||
@@ -42,12 +42,6 @@ pub struct Filter {
|
||||
pub exclude_exotic: bool,
|
||||
}
|
||||
|
||||
impl Default for Filter {
|
||||
fn default() -> Self {
|
||||
Filter { billable_only: false, valid_only: false, chapters: None, exclude_exotic: false }
|
||||
}
|
||||
}
|
||||
|
||||
impl Filter {
|
||||
pub fn accepts(&self, t: &Tags) -> bool {
|
||||
if self.billable_only && !t.billable { return false; }
|
||||
|
||||
Reference in New Issue
Block a user