Last active
December 29, 2019 17:47
-
-
Save delbonis/94a68c15120ca98f31357a871da7095a to your computer and use it in GitHub Desktop.
AHAHAHAHAHAHAHAHAHAHAHAHAH
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
warning: redundant field names in struct initialization | |
--> src/config.rs:24:13 | |
| | |
24 | url: url, | |
| ^^^^^^^^ help: replace it with: `url` | |
| | |
= note: `#[warn(clippy::redundant_field_names)]` on by default | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names | |
warning: redundant field names in struct initialization | |
--> src/config_eval.rs:40:9 | |
| | |
40 | expected: expected, | |
| ^^^^^^^^^^^^^^^^^^ help: replace it with: `expected` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names | |
warning: redundant field names in struct initialization | |
--> src/config_eval.rs:41:9 | |
| | |
41 | found: found, | |
| ^^^^^^^^^^^^ help: replace it with: `found` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names | |
warning: unneeded return statement | |
--> src/config_eval.rs:138:5 | |
| | |
138 | return Ok(ketos::Value::Unit); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `Ok(ketos::Value::Unit)` | |
| | |
= note: `#[warn(clippy::needless_return)]` on by default | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return | |
warning: unneeded return statement | |
--> src/config_eval.rs:179:5 | |
| | |
179 | return Ok(ketos::Value::Unit); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `Ok(ketos::Value::Unit)` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return | |
warning: unneeded return statement | |
--> src/config_eval.rs:196:5 | |
| | |
196 | return Ok(ketos::Value::Unit); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `Ok(ketos::Value::Unit)` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return | |
warning: Constants have by default a `'static` lifetime | |
--> src/contentid.rs:54:24 | |
| | |
54 | const REMOVE_REGEXES: &'static [&'static str] = &[r"\[[a-zA-Z0-9\.\-_]+\]", "Crazy4TV.com"]; | |
| -^^^^^^^--------------- help: consider removing `'static`: `&[&'static str]` | |
| | |
= note: `#[warn(clippy::redundant_static_lifetimes)]` on by default | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes | |
warning: Constants have by default a `'static` lifetime | |
--> src/contentid.rs:54:34 | |
| | |
54 | const REMOVE_REGEXES: &'static [&'static str] = &[r"\[[a-zA-Z0-9\.\-_]+\]", "Crazy4TV.com"]; | |
| -^^^^^^^---- help: consider removing `'static`: `&str` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes | |
warning: Constants have by default a `'static` lifetime | |
--> src/contentid.rs:58:27 | |
| | |
58 | const LABELLING_STRINGS: &'static [&'static str] = &[ | |
| -^^^^^^^--------------- help: consider removing `'static`: `&[&'static str]` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes | |
warning: Constants have by default a `'static` lifetime | |
--> src/contentid.rs:58:37 | |
| | |
58 | const LABELLING_STRINGS: &'static [&'static str] = &[ | |
| -^^^^^^^---- help: consider removing `'static`: `&str` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes | |
warning: Constants have by default a `'static` lifetime | |
--> src/contentid.rs:70:28 | |
| | |
70 | const WEAK_LABEL_REGEXES: &'static [&'static str] = &[ | |
| -^^^^^^^--------------- help: consider removing `'static`: `&[&'static str]` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes | |
warning: Constants have by default a `'static` lifetime | |
--> src/contentid.rs:70:38 | |
| | |
70 | const WEAK_LABEL_REGEXES: &'static [&'static str] = &[ | |
| -^^^^^^^---- help: consider removing `'static`: `&str` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes | |
warning: Constants have by default a `'static` lifetime | |
--> src/contentid.rs:89:23 | |
| | |
89 | const EPISODE_REGEX: &'static str = "S(?P<season>[0-9]{1,2})E(?P<episode>[0-9]{1,2})"; | |
| -^^^^^^^---- help: consider removing `'static`: `&str` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes | |
warning: Constants have by default a `'static` lifetime | |
--> src/contentid.rs:92:27 | |
| | |
92 | const SEASON_DISC_REGEX: &'static str = "S([0-9]{2}D[1-9]{1,2}"; | |
| -^^^^^^^---- help: consider removing `'static`: `&str` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes | |
warning: Constants have by default a `'static` lifetime | |
--> src/contentid.rs:99:28 | |
| | |
99 | const RELEASE_YEAR_REGEX: &'static str = "(19|20)[0-9]{2}"; | |
| -^^^^^^^---- help: consider removing `'static`: `&str` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes | |
warning: Constants have by default a `'static` lifetime | |
--> src/contentid.rs:102:25 | |
| | |
102 | const EDGE_TRIM_CHARS: &'static str = " -_.()|"; | |
| -^^^^^^^---- help: consider removing `'static`: `&str` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes | |
warning: Constants have by default a `'static` lifetime | |
--> src/db/tmdb.rs:20:22 | |
| | |
20 | const CONTENT_TYPE: &'static str = "application/json;charset=utf-8"; | |
| -^^^^^^^---- help: consider removing `'static`: `&str` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes | |
warning: Constants have by default a `'static` lifetime | |
--> src/db/tmdb.rs:22:23 | |
| | |
22 | pub const TOKEN_VAR: &'static str = "BB_THEMOVIEDB_KEY"; | |
| -^^^^^^^---- help: consider removing `'static`: `&str` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes | |
warning: this `else { if .. }` block can be collapsed | |
--> src/identify.rs:230:44 | |
| | |
230 | ... } else { | |
| ______________________________^ | |
231 | | ... if let Some(ep_n) = report.maybe_ep_number { | |
232 | | ... let ep = media::EpisodeNum::Ep(ep_n); | |
233 | | ... match resolve_series_episode(&s, ep, pickdb.clone()) | |
... | | |
246 | | ... } | |
247 | | ... } | |
| |_______________________^ | |
| | |
= note: `#[warn(clippy::collapsible_if)]` on by default | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if | |
help: try | |
| | |
230 | } else if let Some(ep_n) = report.maybe_ep_number { | |
231 | let ep = media::EpisodeNum::Ep(ep_n); | |
232 | match resolve_series_episode(&s, ep, pickdb.clone()) | |
233 | .await? | |
234 | { | |
235 | Some(ep) => { | |
... | |
warning: All the struct fields are matched to a wildcard pattern, consider using `..`. | |
--> src/media.rs:44:13 | |
| | |
44 | TitleData::Episode { id: _, ep_name: _ } => TitleType::Episode, | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: `#[warn(clippy::unneeded_field_pattern)]` on by default | |
= help: Try with `Episode { .. }` instead | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_field_pattern | |
warning: You matched a field with a wildcard pattern. Consider using `..` instead | |
--> src/media.rs:59:42 | |
| | |
59 | TitleData::Episode { id, ep_name: _ } => { | |
| ^^^^^^^^^^ | |
| | |
= help: Try with `Episode { id, .. }` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_field_pattern | |
warning: unneeded return statement | |
--> src/media.rs:134:9 | |
| | |
134 | return None; | |
| ^^^^^^^^^^^^ help: remove `return`: `None` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return | |
warning: unneeded return statement | |
--> src/util.rs:70:5 | |
| | |
70 | return cur[b.len()]; | |
| ^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `cur[b.len()]` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return | |
warning: You are using an explicit closure for cloning elements | |
--> src/config_eval.rs:67:46 | |
| | |
67 | let val: Vec<ketos::Value> = li.iter().skip(1).map(|v| v.clone()).collect(); | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: Consider calling the dedicated `cloned` method: `li.iter().skip(1).cloned()` | |
| | |
= note: `#[warn(clippy::map_clone)]` on by default | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone | |
warning: length comparison to one | |
--> src/config_eval.rs:187:8 | |
| | |
187 | if args.len() < 1 { | |
| ^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `args.is_empty()` | |
| | |
= note: `#[warn(clippy::len_zero)]` on by default | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero | |
warning: single-character string constant used as pattern | |
--> src/contentid.rs:325:24 | |
| | |
325 | if !title.contains("-") && !title.contains("|") { | |
| ^^^ help: try using a char instead: `'-'` | |
| | |
= note: `#[warn(clippy::single_char_pattern)]` on by default | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern | |
warning: single-character string constant used as pattern | |
--> src/contentid.rs:325:48 | |
| | |
325 | if !title.contains("-") && !title.contains("|") { | |
| ^^^ help: try using a char instead: `'|'` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern | |
warning: the function has a cognitive complexity of (29/25) | |
--> src/identify.rs:86:20 | |
| | |
86 | async move { | |
| ____________________^ | |
87 | | let inner = dup.0.as_ref(); | |
88 | | | |
89 | | // First we generate a content ID report, enhance it with the dir | |
... | | |
278 | | Ok(IdMatch::Unknown) | |
279 | | } | |
| |_________^ | |
| | |
= note: `#[warn(clippy::cognitive_complexity)]` on by default | |
= help: you could split it up into multiple smaller functions | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cognitive_complexity | |
warning: length comparison to zero | |
--> src/identify.rs:138:24 | |
| | |
138 | if results.len() == 0 { | |
| ^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `results.is_empty()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero | |
warning: length comparison to zero | |
--> src/identify.rs:188:20 | |
| | |
188 | if exact_matches.len() > 0 { | |
| ^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!exact_matches.is_empty()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero | |
warning: length comparison to zero | |
--> src/identify.rs:268:16 | |
| | |
268 | if collection.len() == 0 { | |
| ^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `collection.is_empty()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero | |
warning: length comparison to zero | |
--> src/identify.rs:269:20 | |
| | |
269 | if db_errs.len() != 0 { | |
| ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!db_errs.is_empty()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero | |
warning: this argument (4 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte) | |
--> src/identify.rs:283:22 | |
| | |
283 | fn check_years_eq(a: &Option<media::Year>, b: &Option<media::Year>) -> bool { | |
| ^^^^^^^^^^^^^^^^^^^^ help: consider passing by value instead: `Option<media::Year>` | |
| | |
= note: `#[warn(clippy::trivially_copy_pass_by_ref)]` on by default | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref | |
warning: this argument (4 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte) | |
--> src/identify.rs:283:47 | |
| | |
283 | fn check_years_eq(a: &Option<media::Year>, b: &Option<media::Year>) -> bool { | |
| ^^^^^^^^^^^^^^^^^^^^ help: consider passing by value instead: `Option<media::Year>` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref | |
warning: you should consider adding a `Default` implementation for `identify::IdentifierBuilder` | |
--> src/identify.rs:374:5 | |
| | |
374 | / pub fn new() -> IdentifierBuilder { | |
375 | | IdentifierBuilder { | |
376 | | inner: IdentifierInner { | |
377 | | db_mappings: HashMap::new(), | |
... | | |
380 | | } | |
381 | | } | |
| |_____^ | |
| | |
= note: `#[warn(clippy::new_without_default)]` on by default | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default | |
help: try this | |
| | |
373 | impl Default for identify::IdentifierBuilder { | |
374 | fn default() -> Self { | |
375 | Self::new() | |
376 | } | |
377 | } | |
| | |
warning: length comparison to zero | |
--> src/identify.rs:398:12 | |
| | |
398 | if self.inner.db_mappings.len() == 0 { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.inner.db_mappings.is_empty()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero | |
warning: this argument (3 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte) | |
--> src/identify.rs:414:17 | |
| | |
414 | fn to_class(&self) -> Option<media::MediaClass> { | |
| ^^^^^ help: consider passing by value instead: `self` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref | |
warning: this argument (3 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte) | |
--> src/identify.rs:422:18 | |
| | |
422 | fn is_forced(&self) -> bool { | |
| ^^^^^ help: consider passing by value instead: `self` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref | |
warning: this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte) | |
--> src/media.rs:180:15 | |
| | |
180 | fn to_str(&self) -> &'static str { | |
| ^^^^^ help: consider passing by value instead: `self` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref | |
warning: this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte) | |
--> src/media.rs:208:15 | |
| | |
208 | fn to_str(&self) -> &'static str { | |
| ^^^^^ help: consider passing by value instead: `self` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref | |
warning: single-character string constant used as pattern | |
--> src/media.rs:223:44 | |
| | |
223 | let parts: Vec<&str> = s.splitn(2, ":").collect(); | |
| ^^^ help: try using a char instead: `':'` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern | |
warning: implementation of inherent method `to_string(&self) -> String` for type `media::MediaClass` | |
--> src/media.rs:235:5 | |
| | |
235 | / pub fn to_string(&self) -> String { | |
236 | | format!("{}:{}", self.0.to_str(), self.1.to_str()) | |
237 | | } | |
| |_____^ | |
| | |
= note: `#[warn(clippy::inherent_to_string)]` on by default | |
= help: implement trait `Display` for type `media::MediaClass` instead | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string | |
warning: this argument (2 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte) | |
--> src/media.rs:235:22 | |
| | |
235 | pub fn to_string(&self) -> String { | |
| ^^^^^ help: consider passing by value instead: `self` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref | |
warning: this argument (2 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte) | |
--> src/media.rs:239:19 | |
| | |
239 | pub fn domain(&self) -> MediaDomain { | |
| ^^^^^ help: consider passing by value instead: `self` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref | |
warning: this argument (2 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte) | |
--> src/media.rs:243:19 | |
| | |
243 | pub fn format(&self) -> MediaFormat { | |
| ^^^^^ help: consider passing by value instead: `self` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref | |
warning: an inclusive range would be more readable | |
--> src/util.rs:58:31 | |
| | |
58 | let mut cur: Vec<usize> = (0..b.len() + 1).collect(); | |
| ^^^^^^^^^^^^^^^^ help: use: `(0..=b.len())` | |
| | |
= note: `#[warn(clippy::range_plus_one)]` on by default | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#range_plus_one | |
warning: Constants have by default a `'static` lifetime | |
--> src/contentid.rs:54:24 | |
| | |
54 | const REMOVE_REGEXES: &'static [&'static str] = &[r"\[[a-zA-Z0-9\.\-_]+\]", "Crazy4TV.com"]; | |
| -^^^^^^^--------------- help: consider removing `'static`: `&[&'static str]` | |
| | |
= note: `#[warn(clippy::redundant_static_lifetimes)]` on by default | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes | |
warning: Constants have by default a `'static` lifetime | |
--> src/contentid.rs:54:34 | |
| | |
54 | const REMOVE_REGEXES: &'static [&'static str] = &[r"\[[a-zA-Z0-9\.\-_]+\]", "Crazy4TV.com"]; | |
| -^^^^^^^---- help: consider removing `'static`: `&str` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes | |
warning: Constants have by default a `'static` lifetime | |
--> src/contentid.rs:58:27 | |
| | |
58 | const LABELLING_STRINGS: &'static [&'static str] = &[ | |
| -^^^^^^^--------------- help: consider removing `'static`: `&[&'static str]` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes | |
warning: Constants have by default a `'static` lifetime | |
--> src/contentid.rs:58:37 | |
| | |
58 | const LABELLING_STRINGS: &'static [&'static str] = &[ | |
| -^^^^^^^---- help: consider removing `'static`: `&str` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes | |
warning: Constants have by default a `'static` lifetime | |
--> src/contentid.rs:70:28 | |
| | |
70 | const WEAK_LABEL_REGEXES: &'static [&'static str] = &[ | |
| -^^^^^^^--------------- help: consider removing `'static`: `&[&'static str]` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes | |
warning: Constants have by default a `'static` lifetime | |
--> src/contentid.rs:70:38 | |
| | |
70 | const WEAK_LABEL_REGEXES: &'static [&'static str] = &[ | |
| -^^^^^^^---- help: consider removing `'static`: `&str` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes | |
warning: Constants have by default a `'static` lifetime | |
--> src/contentid.rs:89:23 | |
| | |
89 | const EPISODE_REGEX: &'static str = "S(?P<season>[0-9]{1,2})E(?P<episode>[0-9]{1,2})"; | |
| -^^^^^^^---- help: consider removing `'static`: `&str` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes | |
warning: Constants have by default a `'static` lifetime | |
--> src/contentid.rs:92:27 | |
| | |
92 | const SEASON_DISC_REGEX: &'static str = "S([0-9]{2}D[1-9]{1,2}"; | |
| -^^^^^^^---- help: consider removing `'static`: `&str` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes | |
warning: Constants have by default a `'static` lifetime | |
--> src/contentid.rs:99:28 | |
| | |
99 | const RELEASE_YEAR_REGEX: &'static str = "(19|20)[0-9]{2}"; | |
| -^^^^^^^---- help: consider removing `'static`: `&str` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes | |
warning: Constants have by default a `'static` lifetime | |
--> src/contentid.rs:102:25 | |
| | |
102 | const EDGE_TRIM_CHARS: &'static str = " -_.()|"; | |
| -^^^^^^^---- help: consider removing `'static`: `&str` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes | |
warning: Constants have by default a `'static` lifetime | |
--> src/db/tmdb.rs:20:22 | |
| | |
20 | const CONTENT_TYPE: &'static str = "application/json;charset=utf-8"; | |
| -^^^^^^^---- help: consider removing `'static`: `&str` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes | |
warning: Constants have by default a `'static` lifetime | |
--> src/db/tmdb.rs:22:23 | |
| | |
22 | pub const TOKEN_VAR: &'static str = "BB_THEMOVIEDB_KEY"; | |
| -^^^^^^^---- help: consider removing `'static`: `&str` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes | |
warning: this `else { if .. }` block can be collapsed | |
--> src/identify.rs:230:44 | |
| | |
230 | ... } else { | |
| ______________________________^ | |
231 | | ... if let Some(ep_n) = report.maybe_ep_number { | |
232 | | ... let ep = media::EpisodeNum::Ep(ep_n); | |
233 | | ... match resolve_series_episode(&s, ep, pickdb.clone()) | |
... | | |
246 | | ... } | |
247 | | ... } | |
| |_______________________^ | |
| | |
= note: `#[warn(clippy::collapsible_if)]` on by default | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if | |
help: try | |
| | |
230 | } else if let Some(ep_n) = report.maybe_ep_number { | |
231 | let ep = media::EpisodeNum::Ep(ep_n); | |
232 | match resolve_series_episode(&s, ep, pickdb.clone()) | |
233 | .await? | |
234 | { | |
235 | Some(ep) => { | |
... | |
warning: All the struct fields are matched to a wildcard pattern, consider using `..`. | |
--> src/media.rs:44:13 | |
| | |
44 | TitleData::Episode { id: _, ep_name: _ } => TitleType::Episode, | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: `#[warn(clippy::unneeded_field_pattern)]` on by default | |
= help: Try with `Episode { .. }` instead | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_field_pattern | |
warning: You matched a field with a wildcard pattern. Consider using `..` instead | |
--> src/media.rs:59:42 | |
| | |
59 | TitleData::Episode { id, ep_name: _ } => { | |
| ^^^^^^^^^^ | |
| | |
= help: Try with `Episode { id, .. }` | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_field_pattern | |
warning: unneeded return statement | |
--> src/media.rs:134:9 | |
| | |
134 | return None; | |
| ^^^^^^^^^^^^ help: remove `return`: `None` | |
| | |
= note: `#[warn(clippy::needless_return)]` on by default | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return | |
warning: unneeded return statement | |
--> src/util.rs:70:5 | |
| | |
70 | return cur[b.len()]; | |
| ^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `cur[b.len()]` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return | |
warning: unneeded return statement | |
--> src/main_bbtool.rs:180:5 | |
| | |
180 | return res; | |
| ^^^^^^^^^^^ help: remove `return`: `res` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return | |
warning: single-character string constant used as pattern | |
--> src/contentid.rs:325:24 | |
| | |
325 | if !title.contains("-") && !title.contains("|") { | |
| ^^^ help: try using a char instead: `'-'` | |
| | |
= note: `#[warn(clippy::single_char_pattern)]` on by default | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern | |
warning: single-character string constant used as pattern | |
--> src/contentid.rs:325:48 | |
| | |
325 | if !title.contains("-") && !title.contains("|") { | |
| ^^^ help: try using a char instead: `'|'` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern | |
warning: the function has a cognitive complexity of (29/25) | |
--> src/identify.rs:86:20 | |
| | |
86 | async move { | |
| ____________________^ | |
87 | | let inner = dup.0.as_ref(); | |
88 | | | |
89 | | // First we generate a content ID report, enhance it with the dir | |
... | | |
278 | | Ok(IdMatch::Unknown) | |
279 | | } | |
| |_________^ | |
| | |
= note: `#[warn(clippy::cognitive_complexity)]` on by default | |
= help: you could split it up into multiple smaller functions | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cognitive_complexity | |
warning: length comparison to zero | |
--> src/identify.rs:138:24 | |
| | |
138 | if results.len() == 0 { | |
| ^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `results.is_empty()` | |
| | |
= note: `#[warn(clippy::len_zero)]` on by default | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero | |
warning: length comparison to zero | |
--> src/identify.rs:188:20 | |
| | |
188 | if exact_matches.len() > 0 { | |
| ^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!exact_matches.is_empty()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero | |
warning: length comparison to zero | |
--> src/identify.rs:268:16 | |
| | |
268 | if collection.len() == 0 { | |
| ^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `collection.is_empty()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero | |
warning: length comparison to zero | |
--> src/identify.rs:269:20 | |
| | |
269 | if db_errs.len() != 0 { | |
| ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!db_errs.is_empty()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero | |
warning: this argument (4 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte) | |
--> src/identify.rs:283:22 | |
| | |
283 | fn check_years_eq(a: &Option<media::Year>, b: &Option<media::Year>) -> bool { | |
| ^^^^^^^^^^^^^^^^^^^^ help: consider passing by value instead: `Option<media::Year>` | |
| | |
= note: `#[warn(clippy::trivially_copy_pass_by_ref)]` on by default | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref | |
warning: this argument (4 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte) | |
--> src/identify.rs:283:47 | |
| | |
283 | fn check_years_eq(a: &Option<media::Year>, b: &Option<media::Year>) -> bool { | |
| ^^^^^^^^^^^^^^^^^^^^ help: consider passing by value instead: `Option<media::Year>` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref | |
warning: length comparison to zero | |
--> src/identify.rs:398:12 | |
| | |
398 | if self.inner.db_mappings.len() == 0 { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.inner.db_mappings.is_empty()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero | |
warning: this argument (3 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte) | |
--> src/identify.rs:414:17 | |
| | |
414 | fn to_class(&self) -> Option<media::MediaClass> { | |
| ^^^^^ help: consider passing by value instead: `self` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref | |
warning: this argument (3 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte) | |
--> src/identify.rs:422:18 | |
| | |
422 | fn is_forced(&self) -> bool { | |
| ^^^^^ help: consider passing by value instead: `self` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref | |
warning: this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte) | |
--> src/media.rs:180:15 | |
| | |
180 | fn to_str(&self) -> &'static str { | |
| ^^^^^ help: consider passing by value instead: `self` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref | |
warning: this argument (1 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte) | |
--> src/media.rs:208:15 | |
| | |
208 | fn to_str(&self) -> &'static str { | |
| ^^^^^ help: consider passing by value instead: `self` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref | |
warning: single-character string constant used as pattern | |
--> src/media.rs:223:44 | |
| | |
223 | let parts: Vec<&str> = s.splitn(2, ":").collect(); | |
| ^^^ help: try using a char instead: `':'` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern | |
warning: implementation of inherent method `to_string(&self) -> String` for type `media::MediaClass` | |
--> src/media.rs:235:5 | |
| | |
235 | / pub fn to_string(&self) -> String { | |
236 | | format!("{}:{}", self.0.to_str(), self.1.to_str()) | |
237 | | } | |
| |_____^ | |
| | |
= note: `#[warn(clippy::inherent_to_string)]` on by default | |
= help: implement trait `Display` for type `media::MediaClass` instead | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string | |
warning: this argument (2 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte) | |
--> src/media.rs:235:22 | |
| | |
235 | pub fn to_string(&self) -> String { | |
| ^^^^^ help: consider passing by value instead: `self` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref | |
warning: this argument (2 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte) | |
--> src/media.rs:239:19 | |
| | |
239 | pub fn domain(&self) -> MediaDomain { | |
| ^^^^^ help: consider passing by value instead: `self` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref | |
warning: this argument (2 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte) | |
--> src/media.rs:243:19 | |
| | |
243 | pub fn format(&self) -> MediaFormat { | |
| ^^^^^ help: consider passing by value instead: `self` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref | |
warning: an inclusive range would be more readable | |
--> src/util.rs:58:31 | |
| | |
58 | let mut cur: Vec<usize> = (0..b.len() + 1).collect(); | |
| ^^^^^^^^^^^^^^^^ help: use: `(0..=b.len())` | |
| | |
= note: `#[warn(clippy::range_plus_one)]` on by default | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#range_plus_one | |
warning: this call to `as_ref` does nothing | |
--> src/main_bbtool.rs:108:49 | |
| | |
108 | let report = match contentid::recognize(recognize_this.as_ref()) { | |
| ^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `recognize_this` | |
| | |
= note: `#[warn(clippy::useless_asref)]` on by default | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_asref | |
warning: `if _ { .. } else { .. }` is an expression | |
--> src/main_bbtool.rs:192:5 | |
| | |
192 | / let mut forced = true; | |
193 | | if mt.chars().last().unwrap() == '?' { | |
194 | | // I hope this does what I think it does. | |
195 | | mt = &mt[..mt.len() - 1]; | |
196 | | forced = false; | |
197 | | } | |
| |_____^ help: it is more idiomatic to write: `let <mut> forced = if mt.chars().last().unwrap() == '?' { ..; false } else { true };` | |
| | |
= note: `#[warn(clippy::useless_let_if_seq)]` on by default | |
= note: you might not need `mut` at all | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_let_if_seq | |
warning: length comparison to zero | |
--> src/main_bbtool.rs:187:8 | |
| | |
187 | if mt.len() == 0 { | |
| ^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `mt.is_empty()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero | |
warning: you should use the `ends_with` method | |
--> src/main_bbtool.rs:193:8 | |
| | |
193 | if mt.chars().last().unwrap() == '?' { | |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `mt.ends_with('?')` | |
| | |
= note: `#[warn(clippy::chars_last_cmp)]` on by default | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#chars_last_cmp | |
warning: length comparison to zero | |
--> src/main_bbtool.rs:200:8 | |
| | |
200 | if mt.len() == 0 { | |
| ^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `mt.is_empty()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero | |
warning: length comparison to zero | |
--> src/main_bbtool.rs:260:8 | |
| | |
260 | if dbs.len() == 0 { | |
| ^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `dbs.is_empty()` | |
| | |
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero | |
Finished dev [unoptimized + debuginfo] target(s) in 0.22s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment