mirror of
https://github.com/JockeTF/fimfareader.git
synced 2024-11-27 07:28:00 +01:00
Fix linter warnings from Clippy
This commit is contained in:
parent
f6f9f815ad
commit
f0d7380fa6
2 changed files with 13 additions and 13 deletions
|
@ -38,7 +38,7 @@ fn strfn(f: StrFn, op: Operator, value: &str) -> Result<Filter> {
|
||||||
};
|
};
|
||||||
|
|
||||||
match op {
|
match op {
|
||||||
Exact => ok!(move |s| f(s) == &value),
|
Exact => ok!(move |s| f(s) == value),
|
||||||
Fuzzy => ok!(move |s| f(s).to_lowercase().contains(&value)),
|
Fuzzy => ok!(move |s| f(s).to_lowercase().contains(&value)),
|
||||||
_ => Err(Error::query("Invalid operation for text type")),
|
_ => Err(Error::query("Invalid operation for text type")),
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ fn dtufn(f: DtuFn, op: Operator, value: &str) -> Result<Filter> {
|
||||||
|
|
||||||
match op {
|
match op {
|
||||||
Exact => ok!(move |s| match f(s) {
|
Exact => ok!(move |s| match f(s) {
|
||||||
Some(dt) => dt == &value,
|
Some(dt) => *dt == value,
|
||||||
None => false,
|
None => false,
|
||||||
}),
|
}),
|
||||||
Fuzzy => ok!(move |s| match f(s) {
|
Fuzzy => ok!(move |s| match f(s) {
|
||||||
|
@ -76,11 +76,11 @@ fn dtufn(f: DtuFn, op: Operator, value: &str) -> Result<Filter> {
|
||||||
None => false,
|
None => false,
|
||||||
}),
|
}),
|
||||||
LessThan => ok!(move |s| match f(s) {
|
LessThan => ok!(move |s| match f(s) {
|
||||||
Some(dt) => dt < &value,
|
Some(dt) => *dt < value,
|
||||||
None => false,
|
None => false,
|
||||||
}),
|
}),
|
||||||
MoreThan => ok!(move |s| match f(s) {
|
MoreThan => ok!(move |s| match f(s) {
|
||||||
Some(dt) => dt > &value,
|
Some(dt) => *dt > value,
|
||||||
None => false,
|
None => false,
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ macro_rules! dfn {
|
||||||
}
|
}
|
||||||
|
|
||||||
named!(source<&str, Source>, preceded!(space0, alt!(
|
named!(source<&str, Source>, preceded!(space0, alt!(
|
||||||
tag!("id") => { ifn!(|s| s.id as i64) } |
|
tag!("id") => { ifn!(|s| s.id) } |
|
||||||
|
|
||||||
tag!("story") => { sfn!(|s| &s.title) } |
|
tag!("story") => { sfn!(|s| &s.title) } |
|
||||||
tag!("title") => { sfn!(|s| &s.title) } |
|
tag!("title") => { sfn!(|s| &s.title) } |
|
||||||
|
@ -58,18 +58,18 @@ named!(source<&str, Source>, preceded!(space0, alt!(
|
||||||
tag!("published") => { dfn!(|s| &s.date_published) } |
|
tag!("published") => { dfn!(|s| &s.date_published) } |
|
||||||
tag!("updated") => { dfn!(|s| &s.date_updated) } |
|
tag!("updated") => { dfn!(|s| &s.date_updated) } |
|
||||||
|
|
||||||
tag!("chapters") => { ifn!(|s| s.num_chapters as i64) } |
|
tag!("chapters") => { ifn!(|s| i64::from(s.num_chapters)) } |
|
||||||
tag!("comments") => { ifn!(|s| s.num_comments as i64) } |
|
tag!("comments") => { ifn!(|s| i64::from(s.num_comments)) } |
|
||||||
tag!("dislikes") => { ifn!(|s| s.num_dislikes as i64) } |
|
tag!("dislikes") => { ifn!(|s| i64::from(s.num_dislikes)) } |
|
||||||
tag!("likes") => { ifn!(|s| s.num_likes as i64) } |
|
tag!("likes") => { ifn!(|s| i64::from(s.num_likes)) } |
|
||||||
tag!("total views") => { ifn!(|s| s.total_num_views as i64) } |
|
tag!("total views") => { ifn!(|s| i64::from(s.total_num_views)) } |
|
||||||
tag!("views") => { ifn!(|s| s.num_views as i64) } |
|
tag!("views") => { ifn!(|s| i64::from(s.num_views)) } |
|
||||||
tag!("words") => { ifn!(|s| s.num_words as i64) } |
|
tag!("words") => { ifn!(|s| i64::from(s.num_words)) } |
|
||||||
|
|
||||||
tag!("author") => { sfn!(|s| &s.author.name) } |
|
tag!("author") => { sfn!(|s| &s.author.name) } |
|
||||||
tag!("author name") => { sfn!(|s| &s.author.name) } |
|
tag!("author name") => { sfn!(|s| &s.author.name) } |
|
||||||
|
|
||||||
tag!("author id") => { ifn!(|s| s.author.id as i64) } |
|
tag!("author id") => { ifn!(|s| s.author.id) } |
|
||||||
tag!("author joined") => { dfn!(|s| &s.author.date_joined) } |
|
tag!("author joined") => { dfn!(|s| &s.author.date_joined) } |
|
||||||
|
|
||||||
tag!("path") => { sfn!(|s| &s.archive.path) } |
|
tag!("path") => { sfn!(|s| &s.archive.path) } |
|
||||||
|
|
Loading…
Reference in a new issue