Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Merge branch 'master' into add-some-redis-caching #499

Merge branch 'master' into add-some-redis-caching

Merge branch 'master' into add-some-redis-caching #499

This check has been archived and is scheduled for deletion. Learn more about checks retention
GitHub Actions / clippy failed Oct 11, 2023 in 0s

clippy

3 errors, 23 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 3
Warning 23
Note 0
Help 0

Versions

  • rustc 1.73.0 (cc66ad468 2023-10-03)
  • cargo 1.73.0 (9c4383fb5 2023-08-26)
  • clippy 0.1.73 (cc66ad4 2023-10-03)

Annotations

Check warning on line 13 in src/scheduler.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

you should consider adding a `Default` implementation for `Scheduler`

warning: you should consider adding a `Default` implementation for `Scheduler`
  --> src/scheduler.rs:9:5
   |
9  | /     pub fn new() -> Self {
10 | |         Scheduler {
11 | |             arbiter: Arbiter::new(),
12 | |         }
13 | |     }
   | |_____^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
help: try adding this
   |
8  + impl Default for Scheduler {
9  +     fn default() -> Self {
10 +         Self::new()
11 +     }
12 + }
   |

Check warning on line 958 in src/routes/v2/teams.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

useless conversion to the same type: `database::models::ids::UserId`

warning: useless conversion to the same type: `database::models::ids::UserId`
   --> src/routes/v2/teams.rs:958:37
    |
958 |         User::clear_project_cache(&[delete_member.user_id.into()], &redis).await?;
    |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `delete_member.user_id`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
    = note: `#[warn(clippy::useless_conversion)]` on by default

Check warning on line 32 in src/ratelimit/memory.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

you should consider adding a `Default` implementation for `MemoryStore`

warning: you should consider adding a `Default` implementation for `MemoryStore`
  --> src/ratelimit/memory.rs:27:5
   |
27 | /     pub fn new() -> Self {
28 | |         debug!("Creating new MemoryStore");
29 | |         MemoryStore {
30 | |             inner: Arc::new(DashMap::<String, (usize, Duration)>::new()),
31 | |         }
32 | |     }
   | |_____^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
help: try adding this
   |
18 + impl Default for MemoryStore {
19 +     fn default() -> Self {
20 +         Self::new()
21 +     }
22 + }
   |

Check warning on line 23 in src/queue/session.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

you should consider adding a `Default` implementation for `AuthQueue`

warning: you should consider adding a `Default` implementation for `AuthQueue`
  --> src/queue/session.rs:18:5
   |
18 | /     pub fn new() -> Self {
19 | |         AuthQueue {
20 | |             session_queue: Mutex::new(HashMap::with_capacity(1000)),
21 | |             pat_queue: Mutex::new(HashSet::with_capacity(1000)),
22 | |         }
23 | |     }
   | |_____^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
help: try adding this
   |
17 + impl Default for AuthQueue {
18 +     fn default() -> Self {
19 +         Self::new()
20 +     }
21 + }
   |

Check warning on line 48 in src/queue/payouts.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

you should consider adding a `Default` implementation for `PayoutsQueue`

warning: you should consider adding a `Default` implementation for `PayoutsQueue`
  --> src/queue/payouts.rs:43:5
   |
43 | /     pub fn new() -> Self {
44 | |         PayoutsQueue {
45 | |             credential: Default::default(),
46 | |             credential_expires: Utc::now() - Duration::days(30),
47 | |         }
48 | |     }
   | |_____^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
help: try adding this
   |
42 + impl Default for PayoutsQueue {
43 +     fn default() -> Self {
44 +         Self::new()
45 +     }
46 + }
   |

Check warning on line 15 in src/queue/download.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

you should consider adding a `Default` implementation for `DownloadQueue`

warning: you should consider adding a `Default` implementation for `DownloadQueue`
  --> src/queue/download.rs:11:5
   |
11 | /     pub fn new() -> Self {
12 | |         DownloadQueue {
13 | |             queue: Mutex::new(Vec::with_capacity(1000)),
14 | |         }
15 | |     }
   | |_____^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
help: try adding this
   |
10 + impl Default for DownloadQueue {
11 +     fn default() -> Self {
12 +         Self::new()
13 +     }
14 + }
   |

Check warning on line 25 in src/queue/analytics.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

you should consider adding a `Default` implementation for `AnalyticsQueue`

warning: you should consider adding a `Default` implementation for `AnalyticsQueue`
  --> src/queue/analytics.rs:19:5
   |
19 | /     pub fn new() -> Self {
20 | |         AnalyticsQueue {
21 | |             views_queue: DashSet::with_capacity(1000),
22 | |             downloads_queue: DashSet::with_capacity(1000),
23 | |             playtime_queue: DashSet::with_capacity(1000),
24 | |         }
25 | |     }
   | |_____^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
help: try adding this
   |
18 + impl Default for AnalyticsQueue {
19 +     fn default() -> Self {
20 +         Self::new()
21 +     }
22 + }
   |

Check failure on line 464 in /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bitflags-1.3.2/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

&-masking with zero

error: &-masking with zero
  --> src/models/users.rs:14:1
   |
14 | / bitflags::bitflags! {
15 | |     #[derive(Serialize, Deserialize)]
16 | |     #[serde(transparent)]
17 | |     pub struct Badges: u64 {
...  |
29 | |     }
30 | | }
   | |_^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bad_bit_mask
   = note: this error originates in the macro `__impl_bitflags` which comes from the expansion of the macro `bitflags::bitflags` (in Nightly builds, run with -Z macro-backtrace for more info)

Check warning on line 88 in src/models/threads.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str`

warning: method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str`
  --> src/models/threads.rs:81:5
   |
81 | /     pub fn from_str(string: &str) -> ThreadType {
82 | |         match string {
83 | |             "report" => ThreadType::Report,
84 | |             "project" => ThreadType::Project,
...  |
87 | |         }
88 | |     }
   | |_____^
   |
   = help: consider implementing the trait `std::str::FromStr` or choosing a less ambiguous method name
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait

Check failure on line 464 in /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bitflags-1.3.2/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

&-masking with zero

error: &-masking with zero
  --> src/models/teams.rs:79:1
   |
79 | / bitflags::bitflags! {
80 | |     #[derive(Serialize, Deserialize)]
81 | |     #[serde(transparent)]
82 | |     pub struct OrganizationPermissions: u64 {
...  |
94 | |     }
95 | | }
   | |_^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bad_bit_mask
   = note: this error originates in the macro `__impl_bitflags` which comes from the expansion of the macro `bitflags::bitflags` (in Nightly builds, run with -Z macro-backtrace for more info)

Check warning on line 763 in src/models/projects.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str`

warning: method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str`
   --> src/models/projects.rs:756:5
    |
756 | /     pub fn from_str(string: &str) -> FileType {
757 | |         match string {
758 | |             "required-resource-pack" => FileType::RequiredResourcePack,
759 | |             "optional-resource-pack" => FileType::OptionalResourcePack,
...   |
762 | |         }
763 | |     }
    | |_____^
    |
    = help: consider implementing the trait `std::str::FromStr` or choosing a less ambiguous method name
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait

Check warning on line 729 in src/models/projects.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str`

warning: method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str`
   --> src/models/projects.rs:721:5
    |
721 | /     pub fn from_str(string: &str) -> DependencyType {
722 | |         match string {
723 | |             "required" => DependencyType::Required,
724 | |             "optional" => DependencyType::Optional,
...   |
728 | |         }
729 | |     }
    | |_____^
    |
    = help: consider implementing the trait `std::str::FromStr` or choosing a less ambiguous method name
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait

Check warning on line 581 in src/models/projects.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str`

warning: method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str`
   --> src/models/projects.rs:573:5
    |
573 | /     pub fn from_str(string: &str) -> VersionStatus {
574 | |         match string {
575 | |             "listed" => VersionStatus::Listed,
576 | |             "draft" => VersionStatus::Draft,
...   |
580 | |         }
581 | |     }
    | |_____^
    |
    = help: consider implementing the trait `std::str::FromStr` or choosing a less ambiguous method name
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait

Check warning on line 443 in src/models/projects.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str`

warning: method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str`
   --> src/models/projects.rs:436:5
    |
436 | /     pub fn from_str(string: &str) -> MonetizationStatus {
437 | |         match string {
438 | |             "force-demonetized" => MonetizationStatus::ForceDemonetized,
439 | |             "demonetized" => MonetizationStatus::Demonetized,
...   |
442 | |         }
443 | |     }
    | |_____^
    |
    = help: consider implementing the trait `std::str::FromStr` or choosing a less ambiguous method name
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait

Check warning on line 323 in src/models/projects.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str`

warning: method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str`
   --> src/models/projects.rs:311:5
    |
311 | /     pub fn from_str(string: &str) -> ProjectStatus {
312 | |         match string {
313 | |             "processing" => ProjectStatus::Processing,
314 | |             "rejected" => ProjectStatus::Rejected,
...   |
322 | |         }
323 | |     }
    | |_____^
    |
    = help: consider implementing the trait `std::str::FromStr` or choosing a less ambiguous method name
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait

Check warning on line 257 in src/models/projects.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str`

warning: method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str`
   --> src/models/projects.rs:250:5
    |
250 | /     pub fn from_str(string: &str) -> SideType {
251 | |         match string {
252 | |             "required" => SideType::Required,
253 | |             "optional" => SideType::Optional,
...   |
256 | |         }
257 | |     }
    | |_____^
    |
    = help: consider implementing the trait `std::str::FromStr` or choosing a less ambiguous method name
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait

Check failure on line 464 in /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bitflags-1.3.2/src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

&-masking with zero

error: &-masking with zero
   --> src/models/pats.rs:12:1
    |
12  | / bitflags::bitflags! {
13  | |     #[derive(Serialize, Deserialize)]
14  | |     #[serde(transparent)]
15  | |     pub struct Scopes: u64 {
...   |
107 | |     }
108 | | }
    | |_^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bad_bit_mask
    = note: `#[deny(clippy::bad_bit_mask)]` on by default
    = note: this error originates in the macro `__impl_bitflags` which comes from the expansion of the macro `bitflags::bitflags` (in Nightly builds, run with -Z macro-backtrace for more info)

Check warning on line 91 in src/models/collections.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str`

warning: method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str`
  --> src/models/collections.rs:83:5
   |
83 | /     pub fn from_str(string: &str) -> CollectionStatus {
84 | |         match string {
85 | |             "listed" => CollectionStatus::Listed,
86 | |             "unlisted" => CollectionStatus::Unlisted,
...  |
90 | |         }
91 | |     }
   | |_____^
   |
   = help: consider implementing the trait `std::str::FromStr` or choosing a less ambiguous method name
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait
   = note: `#[warn(clippy::should_implement_trait)]` on by default

Check warning on line 12 in src/file_hosting/mock.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

you should consider adding a `Default` implementation for `MockHost`

warning: you should consider adding a `Default` implementation for `MockHost`
  --> src/file_hosting/mock.rs:10:5
   |
10 | /     pub fn new() -> Self {
11 | |         MockHost(())
12 | |     }
   | |_____^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
   = note: `#[warn(clippy::new_without_default)]` on by default
help: try adding this
   |
9  + impl Default for MockHost {
10 +     fn default() -> Self {
11 +         Self::new()
12 +     }
13 + }
   |

Check warning on line 383 in src/database/models/user_item.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`

warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`
   --> src/database/models/user_item.rs:383:22
    |
383 |                     .into_iter()
    |                      ^^^^^^^^^ help: call directly: `iter`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref

Check warning on line 363 in src/database/models/user_item.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`

warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `slice`
   --> src/database/models/user_item.rs:363:35
    |
363 |             .delete_many(user_ids.into_iter().flat_map(|(id, username)| {
    |                                   ^^^^^^^^^ help: call directly: `iter`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref
    = note: `#[warn(clippy::into_iter_on_ref)]` on by default

Check warning on line 237 in src/clickhouse/fetch.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

called `unwrap` on `projects` after checking its variant with `is_some`

warning: called `unwrap` on `projects` after checking its variant with `is_some`
   --> src/clickhouse/fetch.rs:237:28
    |
236 |     if projects.is_some() {
    |     --------------------- help: try: `if let Some(..) = projects`
237 |         query = query.bind(projects.unwrap().iter().map(|x| x.0).collect::<Vec<_>>());
    |                            ^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap

Check warning on line 174 in src/clickhouse/fetch.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

called `unwrap` on `projects` after checking its variant with `is_some`

warning: called `unwrap` on `projects` after checking its variant with `is_some`
   --> src/clickhouse/fetch.rs:174:28
    |
173 |     if projects.is_some() {
    |     --------------------- help: try: `if let Some(..) = projects`
174 |         query = query.bind(projects.unwrap().iter().map(|x| x.0).collect::<Vec<_>>());
    |                            ^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap

Check warning on line 127 in src/clickhouse/fetch.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

called `unwrap` on `projects` after checking its variant with `is_some`

warning: called `unwrap` on `projects` after checking its variant with `is_some`
   --> src/clickhouse/fetch.rs:127:28
    |
126 |     if projects.is_some() {
    |     --------------------- help: try: `if let Some(..) = projects`
127 |         query = query.bind(projects.unwrap().iter().map(|x| x.0).collect::<Vec<_>>());
    |                            ^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap

Check warning on line 80 in src/clickhouse/fetch.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

called `unwrap` on `projects` after checking its variant with `is_some`

warning: called `unwrap` on `projects` after checking its variant with `is_some`
  --> src/clickhouse/fetch.rs:80:28
   |
79 |     if projects.is_some() {
   |     --------------------- help: try: `if let Some(..) = projects`
80 |         query = query.bind(projects.unwrap().iter().map(|x| x.0).collect::<Vec<_>>());
   |                            ^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap
   = note: `#[warn(clippy::unnecessary_unwrap)]` on by default