Skip to content

Update Backend Dependencies #470

Update Backend Dependencies

Update Backend Dependencies #470

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

clippy

1 error, 42 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 1
Warning 42
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 67 in src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

single-character string constant used as pattern

warning: single-character string constant used as pattern
  --> src/lib.rs:67:59
   |
67 |             features: env!("VERGEN_CARGO_FEATURES").split(",").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
   = note: `#[warn(clippy::single_char_pattern)]` on by default

Check warning on line 119 in src/utils.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

redundant closure

warning: redundant closure
   --> src/utils.rs:119:44
    |
119 |         String::from_utf8(decoded).map_err(|x| actix_web::error::ErrorBadRequest(x))
    |                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `actix_web::error::ErrorBadRequest`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure

Check warning on line 118 in src/utils.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

redundant closure

warning: redundant closure
   --> src/utils.rs:118:45
    |
118 |         let decoded = decode(input).map_err(|e| actix_web::error::ErrorBadRequest(e))?;
    |                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `actix_web::error::ErrorBadRequest`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
    = note: `#[warn(clippy::redundant_closure)]` on by default

Check warning on line 105 in src/utils.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this `if` branch is empty

warning: this `if` branch is empty
   --> src/utils.rs:105:5
    |
105 |     if x.is_err() {}
    |     ^^^^^^^^^^^^^^^^ help: you can remove it: `x.is_err();`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_if

Check warning on line 187 in src/system/permissions/permissions_checker.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> src/system/permissions/permissions_checker.rs:187:41
    |
187 |                 let can_read = can_read(&self, repo)?;
    |                                         ^^^^^ help: change this to: `self`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 172 in src/system/permissions/permissions_checker.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler
   --> src/system/permissions/permissions_checker.rs:172:35
    |
172 |         let can_read = can_deploy(&self, repo)?;
    |                                   ^^^^^ help: change this to: `self`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 158 in src/storage/multi/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this `MutexGuard` is held across an `await` point

warning: this `MutexGuard` is held across an `await` point
   --> src/storage/multi/mod.rs:158:13
    |
158 |         let storages_ref = self.storages.read();
    |             ^^^^^^^^^^^^
    |
    = help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling await
note: these are all the `await` points this lock is held through
   --> src/storage/multi/mod.rs:158:9
    |
158 | /         let storages_ref = self.storages.read();
159 | |         let mut storages = Vec::with_capacity(storages_ref.len() + 1);
160 | |         for (storage_name, storage) in storages_ref.iter() {
161 | |             if storage_name.eq(&name) {
...   |
190 | |         Ok(())
191 | |     }
    | |_____^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#await_holding_lock

Check warning on line 128 in src/storage/multi/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this `MutexGuard` is held across an `await` point

warning: this `MutexGuard` is held across an `await` point
   --> src/storage/multi/mod.rs:128:13
    |
128 |         let storage_ref = self.storages.read();
    |             ^^^^^^^^^^^
    |
    = help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling await
note: these are all the `await` points this lock is held through
   --> src/storage/multi/mod.rs:128:9
    |
128 | /         let storage_ref = self.storages.read();
129 | |         let mut storages = Vec::with_capacity(storage_ref.len() + 1);
130 | |
131 | |         for (storage_name, value) in storage_ref.iter() {
...   |
150 | |         Ok(())
151 | |     }
    | |_____^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#await_holding_lock
    = note: `#[warn(clippy::await_holding_lock)]` on by default

Check warning on line 84 in src/storage/multi/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

you are using an explicit closure for cloning elements

warning: you are using an explicit closure for cloning elements
  --> src/storage/multi/mod.rs:84:9
   |
84 |         self.storages.read().get(name).map(|x| x.clone())
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `cloned` method: `self.storages.read().get(name).cloned()`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone
   = note: `#[warn(clippy::map_clone)]` on by default

Check warning on line 417 in src/storage/local_storage/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> src/storage/local_storage/mod.rs:417:79
    |
417 |         let file_location = self.get_repository_folder(&repository.name).join(&location);
    |                                                                               ^^^^^^^^^ help: change this to: `location`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 136 in src/storage/file.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this `if` branch is empty

warning: this `if` branch is empty
   --> src/storage/file.rs:136:9
    |
136 |         if request.method() == Method::HEAD {}
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can remove it: `request.method() == Method::HEAD;`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_if
    = note: `#[warn(clippy::needless_if)]` on by default

Check warning on line 148 in src/repository/settings/repository_page.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

use of `unwrap_or_else` to construct default value

warning: use of `unwrap_or_else` to construct default value
   --> src/repository/settings/repository_page.rs:148:25
    |
148 |         let page = body.unwrap_or_else(|| "".to_string());
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
    = note: `#[warn(clippy::unwrap_or_default)]` on by default

Check warning on line 80 in src/repository/settings/repository_page.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

warning: unneeded `return` statement
  --> src/repository/settings/repository_page.rs:79:17
   |
79 | /                 return Ok(actix_web::HttpResponse::BadRequest()
80 | |                     .body("Repository type not supported".to_string()));
   | |_______________________________________________________________________^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
   = note: `#[warn(clippy::needless_return)]` on by default
help: remove `return`
   |
79 ~                 Ok(actix_web::HttpResponse::BadRequest()
80 ~                     .body("Repository type not supported".to_string()))
   |

Check warning on line 52 in src/repository/settings/badge.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this `impl` can be derived

warning: this `impl` can be derived
  --> src/repository/settings/badge.rs:48:1
   |
48 | / impl Default for BadgeStyle {
49 | |     fn default() -> Self {
50 | |         BadgeStyle::Flat
51 | |     }
52 | | }
   | |_^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls
   = help: remove the manual implementation...
help: ...and instead derive it...
   |
42 + #[derive(Default)]
43 | pub enum BadgeStyle {
   |
help: ...and mark the default variant
   |
43 ~     #[default]
44 ~     Flat,
   |

Check warning on line 203 in src/repository/npm/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> src/repository/npm/mod.rs:203:57
    |
203 |             let created_response = serde_json::to_value(&LoginResponse { ok: message })
    |                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `LoginResponse { ok: message }`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 165 in src/repository/npm/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits
   --> src/repository/npm/mod.rs:165:38
    |
165 |                 serde_json::to_value(&get_response.unwrap()).map_err(InternalError::from)?;
    |                                      ^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `get_response.unwrap()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Check warning on line 192 in src/repository/settings/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

calls to `push` immediately after creation

warning: calls to `push` immediately after creation
   --> src/repository/settings/mod.rs:186:17
    |
186 | /                 let mut layout = Vec::new();
187 | |                 $(
188 | |                     layout.push(crate::repository::settings::RepositoryLayoutValue{
189 | |                         config_name: stringify!($name),
190 | |                         config_proper_name: stringify!($name),
191 | |                         schema: schemars::schema_for!($config)
192 | |                     });
    | |_______________________^ help: consider using the `vec![]` macro: `let layout = vec![..];`
    |
   ::: src/repository/npm/mod.rs:93:1
    |
93  | / crate::repository::settings::define_configs_on_handler!(
94  | |     NPMHandler<StorageType>,
95  | |     badge,
96  | |     BadgeSettings,
97  | |     frontend,
98  | |     Frontend
99  | | );
    | |_- in this macro invocation
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push
    = note: this warning originates in the macro `crate::repository::settings::define_config_layout` which comes from the expansion of the macro `crate::repository::settings::define_configs_on_handler` (in Nightly builds, run with -Z macro-backtrace for more info)

Check warning on line 41 in src/repository/nitro/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

large size difference between variants

warning: large size difference between variants
  --> src/repository/nitro/mod.rs:38:1
   |
38 | / pub enum NitroFileResponseType {
39 | |     Project(Project),
   | |     ---------------- the largest variant contains at least 320 bytes
40 | |     Other,
   | |     ----- the second-largest variant carries no data at all
41 | | }
   | |_^ the entire enum is at least 320 bytes
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant
   = note: `#[warn(clippy::large_enum_variant)]` on by default
help: consider boxing the large fields to reduce the total size of the enum
   |
39 |     Project(Box<Project>),
   |             ~~~~~~~~~~~~

Check warning on line 59 in src/repository/maven/settings/macros.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this `if let` can be collapsed into the outer `if let`

warning: this `if let` can be collapsed into the outer `if let`
   --> src/repository/maven/settings/macros.rs:50:21
    |
50  | / ...   if let crate::repository::maven::MavenHandler::$maven_type(ref mut repository) = repository {
51  | | ...       let _value = crate::repository::settings::RepositoryConfigHandler::<$config>::get(repository);
52  | | ...       let value = crate::repository::settings::RepositoryConfigHandler::<$config>::update( repository, body).map(|_| true);
53  | | ...       if let Err(e) = storage.save_repository_config(repository.get_repository(),  crate::repository::settings::RepositoryConfigHandl...
...   |
58  | | ...       Ok(false)
59  | | ...   }
    | |_______^
    |
   ::: src/repository/maven/staging/mod.rs:275:5
    |
275 | /     crate::repository::maven::settings::macros::define_repository_config_handlers_group!(
276 | |         super::MavenStagingConfig,
277 | |         stage_settings,
278 | |         Staging
279 | |     );
    | |_____- in this macro invocation
    |
help: the outer pattern can be modified to include the inner pattern
   --> src/repository/maven/settings/macros.rs:49:98
    |
49  |                   let result = if let  crate::repository::handler::DynamicRepositoryHandler::Maven(ref mut repository) = repository {
    |                                                                                                    ^^^^^^^^^^^^^^^^^^ replace this binding
50  |                       if let crate::repository::maven::MavenHandler::$maven_type(ref mut repository) = repository {
    |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern
    |
   ::: src/repository/maven/staging/mod.rs:275:5
    |
275 | /     crate::repository::maven::settings::macros::define_repository_config_handlers_group!(
276 | |         super::MavenStagingConfig,
277 | |         stage_settings,
278 | |         Staging
279 | |     );
    | |     -
    | |_____|
    | |_____in this macro invocation
    |       in this macro invocation
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match
    = note: this warning originates in the macro `crate::repository::maven::settings::macros::define_repository_config_set` which comes from the expansion of the macro `crate::repository::maven::settings::macros::define_repository_config_handlers_group` (in Nightly builds, run with -Z macro-backtrace for more info)

Check warning on line 21 in src/repository/maven/settings/macros.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this `if let` can be collapsed into the outer `if let`

warning: this `if let` can be collapsed into the outer `if let`
   --> src/repository/maven/settings/macros.rs:18:17
    |
18  | /                 if let crate::repository::maven::MavenHandler::$maven_type(ref repository) = repository {
19  | |                     let value = crate::repository::settings::RepositoryConfigHandler::<$config>::get(repository);
20  | |                     return Ok(actix_web::HttpResponse::Ok().json(value));
21  | |                 }
    | |_________________^
    |
   ::: src/repository/maven/staging/mod.rs:275:5
    |
275 | /     crate::repository::maven::settings::macros::define_repository_config_handlers_group!(
276 | |         super::MavenStagingConfig,
277 | |         stage_settings,
278 | |         Staging
279 | |     );
    | |_____- in this macro invocation
    |
help: the outer pattern can be modified to include the inner pattern
   --> src/repository/maven/settings/macros.rs:17:82
    |
17  |               if let  crate::repository::handler::DynamicRepositoryHandler::Maven( repository) = repository.as_ref() {
    |                                                                                    ^^^^^^^^^^ replace this binding
18  |                   if let crate::repository::maven::MavenHandler::$maven_type(ref repository) = repository {
    |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern
    |
   ::: src/repository/maven/staging/mod.rs:275:5
    |
275 | /     crate::repository::maven::settings::macros::define_repository_config_handlers_group!(
276 | |         super::MavenStagingConfig,
277 | |         stage_settings,
278 | |         Staging
279 | |     );
    | |     -
    | |_____|
    | |_____in this macro invocation
    |       in this macro invocation
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match
    = note: this warning originates in the macro `crate::repository::maven::settings::macros::define_repository_config_get` which comes from the expansion of the macro `crate::repository::maven::settings::macros::define_repository_config_handlers_group` (in Nightly builds, run with -Z macro-backtrace for more info)

Check warning on line 104 in src/repository/maven/staging/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this lifetime isn't used in the impl

warning: this lifetime isn't used in the impl
   --> src/repository/maven/staging/mod.rs:104:6
    |
104 | impl<'a, S: Storage> StageHandler<S> for StagingRepository<S> {
    |      ^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes
    = note: `#[warn(clippy::extra_unused_lifetimes)]` on by default

Check warning on line 192 in src/repository/settings/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

calls to `push` immediately after creation

warning: calls to `push` immediately after creation
   --> src/repository/settings/mod.rs:186:17
    |
186 | /                 let mut layout = Vec::new();
187 | |                 $(
188 | |                     layout.push(crate::repository::settings::RepositoryLayoutValue{
189 | |                         config_name: stringify!($name),
190 | |                         config_proper_name: stringify!($name),
191 | |                         schema: schemars::schema_for!($config)
192 | |                     });
    | |_______________________^ help: consider using the `vec![]` macro: `let layout = vec![..];`
    |
   ::: src/repository/maven/staging/mod.rs:95:1
    |
95  | / crate::repository::settings::define_configs_on_handler!(
96  | |     StagingRepository<StorageType>,
97  | |     stage_settings,
98  | |     MavenStagingConfig,
99  | |     repository_page,
100 | |     RepositoryPage
101 | | );
    | |_- in this macro invocation
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push
    = note: this warning originates in the macro `crate::repository::settings::define_config_layout` which comes from the expansion of the macro `crate::repository::settings::define_configs_on_handler` (in Nightly builds, run with -Z macro-backtrace for more info)

Check warning on line 55 in src/repository/maven/staging/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this `impl` can be derived

warning: this `impl` can be derived
  --> src/repository/maven/staging/mod.rs:46:1
   |
46 | / impl Default for MavenStagingConfig {
47 | |     fn default() -> Self {
48 | |         Self {
49 | |             parent: ProxySettings::default(),
...  |
54 | |     }
55 | | }
   | |_^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls
   = note: `#[warn(clippy::derivable_impls)]` on by default
   = help: remove the manual implementation...
help: ...and instead derive it
   |
37 + #[derive(Default)]
38 | pub struct MavenStagingConfig {
   |

Check warning on line 34 in src/repository/maven/staging/git.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many arguments (8/7)

warning: this function has too many arguments (8/7)
  --> src/repository/maven/staging/git.rs:25:1
   |
25 | / pub async fn stage_to_git(
26 | |     username: String,
27 | |     password: String,
28 | |     url: String,
...  |
33 | |     model: UserSafeData,
34 | | ) -> Result<(), GitStageError> {
   | |______________________________^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
   = note: `#[warn(clippy::too_many_arguments)]` on by default

Check warning on line 23 in src/repository/maven/staging/git.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

all variants have the same postfix: `Error`

warning: all variants have the same postfix: `Error`
  --> src/repository/maven/staging/git.rs:16:1
   |
16 | / pub enum GitStageError {
17 | |     #[error("{0}")]
18 | |     GitError(#[from] git2::Error),
19 | |     #[error("{0}")]
...  |
22 | |     SerdeError(#[from] quick_xml::de::DeError),
23 | | }
   | |_^
   |
   = help: remove the postfixes and use full paths to the variants instead of glob imports
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#enum_variant_names