Skip to content

Rustus has been rewritten from scratch #180

Rustus has been rewritten from scratch

Rustus has been rewritten from scratch #180

GitHub Actions / clippy failed Nov 17, 2023 in 2s

clippy

65 errors

Details

Results

Message level Amount
Internal compiler error 0
Error 65
Warning 0
Note 0
Help 0

Versions

  • rustc 1.76.0-nightly (a57770440 2023-11-16)
  • cargo 1.76.0-nightly (2c03e0e2d 2023-11-16)
  • clippy 0.1.76 (a577704 2023-11-16)

Annotations

Check failure on line 80 in src/notifiers/impls/amqp_notifier.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused `async` for function with no await statements

error: unused `async` for function with no await statements
  --> src/notifiers/impls/amqp_notifier.rs:44:5
   |
44 | /     pub async fn new(options: AMQPHooksOptions) -> RustusResult<Self> {
45 | |         let manager = ConnnectionPool::new(
46 | |             options.hooks_amqp_url.unwrap().clone(),
47 | |             ConnectionProperties::default(),
...  |
79 | |         })
80 | |     }
   | |_____^
   |
   = help: consider removing the `async` from this function
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_async
   = note: `-D clippy::unused-async` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::unused_async)]`

Check failure on line 19 in src/utils/lapin_pool.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this method could have a `#[must_use]` attribute

error: this method could have a `#[must_use]` attribute
  --> src/utils/lapin_pool.rs:19:5
   |
19 |     pub fn new(url: String, properties: ConnectionProperties) -> Self {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn new(url: String, properties: ConnectionProperties) -> Self`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate

Check failure on line 13 in src/utils/lapin_pool.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this method could have a `#[must_use]` attribute

error: this method could have a `#[must_use]` attribute
  --> src/utils/lapin_pool.rs:13:5
   |
13 |     pub fn new(pool: mobc::Pool<ConnnectionPool>) -> Self {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn new(pool: mobc::Pool<ConnnectionPool>) -> Self`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate

Check failure on line 88 in src/utils/headers.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

variables can be used directly in the `format!` string

error: variables can be used directly in the `format!` string
  --> src/utils/headers.rs:88:9
   |
88 |         format!("{}; filename=\"{}\"", disposition, filename)
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
help: change this to
   |
88 -         format!("{}; filename=\"{}\"", disposition, filename)
88 +         format!("{disposition}; filename=\"{filename}\"")
   |

Check failure on line 9 in src/utils/dir_struct.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function could have a `#[must_use]` attribute

error: this function could have a `#[must_use]` attribute
 --> src/utils/dir_struct.rs:9:1
  |
9 | pub fn substr_time(dir_structure: &str, time: chrono::DateTime<chrono::Utc>) -> String {
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn substr_time(dir_structure: &str, time: chrono::DateTime<chrono::Utc>) -> String`
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate

Check failure on line 4 in src/utils/dir_struct.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function could have a `#[must_use]` attribute

error: this function could have a `#[must_use]` attribute
 --> src/utils/dir_struct.rs:4:1
  |
4 | pub fn substr_now(dir_structure: &str) -> String {
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn substr_now(dir_structure: &str) -> String`
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate

Check failure on line 16 in src/state.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

docs for function returning `Result` missing `# Errors` section

error: docs for function returning `Result` missing `# Errors` section
  --> src/state.rs:16:5
   |
16 |     pub async fn from_config(config: &Config) -> RustusResult<Self> {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc

Check failure on line 9 in src/state.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

item name ends with its containing module's name

error: item name ends with its containing module's name
 --> src/state.rs:9:12
  |
9 | pub struct RustusState {
  |            ^^^^^^^^^^^
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions

Check failure on line 113 in src/server/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

item name ends with its containing module's name

error: item name ends with its containing module's name
   --> src/server/mod.rs:113:14
    |
113 | pub async fn start_server(config: Config) -> RustusResult<()> {
    |              ^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions

Check failure on line 113 in src/server/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

docs for function returning `Result` missing `# Errors` section

error: docs for function returning `Result` missing `# Errors` section
   --> src/server/mod.rs:113:1
    |
113 | pub async fn start_server(config: Config) -> RustusResult<()> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc

Check failure on line 73 in src/server/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

error: unneeded `return` statement
  --> src/server/mod.rs:73:5
   |
73 |     return resp;
   |     ^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
   = note: `-D clippy::needless-return` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::needless_return)]`
help: remove `return`
   |
73 -     return resp;
73 +     resp
   |

Check failure on line 23 in src/server/routes/upload.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

variables can be used directly in the `format!` string

error: variables can be used directly in the `format!` string
  --> src/server/routes/upload.rs:23:5
   |
23 |     println!("hehehe {}", upload_id);
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
   = note: `-D clippy::uninlined-format-args` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::uninlined_format_args)]`
help: change this to
   |
23 -     println!("hehehe {}", upload_id);
23 +     println!("hehehe {upload_id}");
   |

Check failure on line 17 in src/server/routes/upload.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

item name starts with its containing module's name

error: item name starts with its containing module's name
  --> src/server/routes/upload.rs:17:14
   |
17 | pub async fn upload_chunk(
   |              ^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions

Check failure on line 17 in src/server/routes/info.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

redundant closure

error: redundant closure
  --> src/server/routes/info.rs:17:14
   |
17 |         .map(|ext| ext.to_string())
   |              ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the method itself: `std::string::ToString::to_string`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure_for_method_calls
   = note: `-D clippy::redundant-closure-for-method-calls` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::redundant_closure_for_method_calls)]`

Check failure on line 9 in src/server/routes/info.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

item name ends with its containing module's name

error: item name ends with its containing module's name
 --> src/server/routes/info.rs:9:14
  |
9 | pub async fn get_server_info(
  |              ^^^^^^^^^^^^^^^
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions

Check failure on line 12 in src/server/routes/file_info.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

item name ends with its containing module's name

error: item name ends with its containing module's name
  --> src/server/routes/file_info.rs:12:14
   |
12 | pub async fn get_file_info(
   |              ^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions

Check failure on line 15 in src/server/routes/delete.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

item name starts with its containing module's name

error: item name starts with its containing module's name
  --> src/server/routes/delete.rs:15:14
   |
15 | pub async fn delete_upload(
   |              ^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions

Check failure on line 137 in src/server/routes/create.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function has too many lines (109/100)

error: this function has too many lines (109/100)
   --> src/server/routes/create.rs:14:1
    |
14  | / pub async fn create_upload(
15  | |     State(ref state): State<RustusState>,
16  | |     headers: HeaderMap,
17  | |     _body: Bytes,
...   |
136 | |         .into_response())
137 | | }
    | |_^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_lines
    = note: `-D clippy::too-many-lines` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::too_many_lines)]`

Check failure on line 14 in src/server/routes/create.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

item name starts with its containing module's name

error: item name starts with its containing module's name
  --> src/server/routes/create.rs:14:14
   |
14 | pub async fn create_upload(
   |              ^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_name_repetitions

Check failure on line 86 in src/notifiers/impls/amqp_notifier.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this method could have a `#[must_use]` attribute

error: this method could have a `#[must_use]` attribute
  --> src/notifiers/impls/amqp_notifier.rs:86:5
   |
86 |     pub fn get_queue_name(&self, hook: &Hook) -> String {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn get_queue_name(&self, hook: &Hook) -> String`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate

Check failure on line 44 in src/notifiers/impls/amqp_notifier.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

docs for function returning `Result` missing `# Errors` section

error: docs for function returning `Result` missing `# Errors` section
  --> src/notifiers/impls/amqp_notifier.rs:44:5
   |
44 |     pub async fn new(options: AMQPHooksOptions) -> RustusResult<Self> {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc

Check failure on line 44 in src/notifiers/impls/amqp_notifier.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

docs for function which may panic missing `# Panics` section

error: docs for function which may panic missing `# Panics` section
  --> src/notifiers/impls/amqp_notifier.rs:44:5
   |
44 |     pub async fn new(options: AMQPHooksOptions) -> RustusResult<Self> {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: first possible panic found here
  --> src/notifiers/impls/amqp_notifier.rs:46:13
   |
46 |             options.hooks_amqp_url.unwrap().clone(),
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc

Check failure on line 39 in src/notifiers/impls/amqp_notifier.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

item in documentation is missing backticks

error: item in documentation is missing backticks
  --> src/notifiers/impls/amqp_notifier.rs:39:27
   |
39 | /// ManagerConnection for ChannelPool.
   |                           ^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
help: try
   |
39 | /// ManagerConnection for `ChannelPool`.
   |                           ~~~~~~~~~~~~~

Check failure on line 39 in src/notifiers/impls/amqp_notifier.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

item in documentation is missing backticks

error: item in documentation is missing backticks
  --> src/notifiers/impls/amqp_notifier.rs:39:5
   |
39 | /// ManagerConnection for ChannelPool.
   |     ^^^^^^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
help: try
   |
39 | /// `ManagerConnection` for ChannelPool.
   |     ~~~~~~~~~~~~~~~~~~~

Check failure on line 17 in src/notifiers/impls/dir_notifier.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this method could have a `#[must_use]` attribute

error: this method could have a `#[must_use]` attribute
  --> src/notifiers/impls/dir_notifier.rs:17:5
   |
17 |     pub fn new(dir: PathBuf) -> Self {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add the attribute: `#[must_use] pub fn new(dir: PathBuf) -> Self`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#must_use_candidate