Skip to content

this is better

this is better #83

GitHub Actions / clippy failed Sep 23, 2023 in 0s

clippy

38 errors, 6 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 38
Warning 6
Note 0
Help 0

Versions

  • rustc 1.72.1 (d5c2e9c34 2023-09-13)
  • cargo 1.72.1 (103a7ff2e 2023-08-15)
  • clippy 0.1.72 (d5c2e9c 2023-09-13)

Annotations

Check warning on line 9 in src/util/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused import: `Context`

warning: unused import: `Context`
 --> src/util/mod.rs:9:14
  |
9 | use anyhow::{Context, Result};
  |              ^^^^^^^

Check warning on line 10 in src/util/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused import: `futures::StreamExt`

warning: unused import: `futures::StreamExt`
  --> src/util/mod.rs:10:5
   |
10 | use futures::StreamExt;
   |     ^^^^^^^^^^^^^^^^^^

Check failure on line 106 in src/model/downloadable/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

mismatched types

error[E0308]: mismatched types
   --> src/model/downloadable/mod.rs:106:27
    |
106 |                 filename: filename.clone(),
    |                           ^^^^^^^^^^^^^^^^ expected `String`, found `Option<String>`
    |
    = note: expected struct `std::string::String`
                 found enum `std::option::Option<std::string::String>`

Check warning on line 205 in src/sources/github.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused variable: `has_in_cache`

warning: unused variable: `has_in_cache`
   --> src/sources/github.rs:205:13
    |
205 |         let has_in_cache = self.0.has_in_cache(CACHE_DIR, &cached_file_path);
    |             ^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_has_in_cache`
    |
    = note: `#[warn(unused_variables)]` on by default

Check failure on line 183 in src/model/downloadable/packwiz.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

no method named `get_filename` found for reference `&model::downloadable::Downloadable` in the current scope

error[E0599]: no method named `get_filename` found for reference `&model::downloadable::Downloadable` in the current scope
   --> src/model/downloadable/packwiz.rs:183:37
    |
183 |                 let filename = self.get_filename(server, http_client).await?;
    |                                     ^^^^^^^^^^^^ help: there is a method with a similar name: `get_type_name`

Check failure on line 116 in src/model/downloadable/packwiz.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

cannot find function `fetch_curserinth_versions` in this scope

error[E0425]: cannot find function `fetch_curserinth_versions` in this scope
   --> src/model/downloadable/packwiz.rs:116:32
    |
116 |                 let versions = fetch_curserinth_versions(http_client, id, None).await?;
    |                                ^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope

Check failure on line 108 in src/model/downloadable/packwiz.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

cannot find function `fetch_curserinth_project` in this scope

error[E0425]: cannot find function `fetch_curserinth_project` in this scope
   --> src/model/downloadable/packwiz.rs:108:28
    |
108 |                 let proj = fetch_curserinth_project(http_client, id).await?;
    |                            ^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope

Check failure on line 69 in src/commands/add/modrinth.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the size for values of type `[sources::modrinth::ModrinthVersion]` cannot be known at compilation time

error[E0277]: the size for values of type `[sources::modrinth::ModrinthVersion]` cannot be known at compilation time
  --> src/commands/add/modrinth.rs:69:94
   |
69 |     let versions = modrinth::fetch_modrinth_versions(&http_client, &project.slug, None).await?;
   |                                                                                              ^ doesn't have a size known at compile-time
   |
   = help: the trait `std::marker::Sized` is not implemented for `[sources::modrinth::ModrinthVersion]`
note: required by a bound in `std::ops::ControlFlow::Break`
  --> /rustc/d5c2e9c342b358556da91d61ed4133f6f50fc0c3/library/core/src/ops/control_flow.rs:93:5

Check failure on line 69 in src/commands/add/modrinth.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the size for values of type `[sources::modrinth::ModrinthVersion]` cannot be known at compilation time

error[E0277]: the size for values of type `[sources::modrinth::ModrinthVersion]` cannot be known at compilation time
  --> src/commands/add/modrinth.rs:69:20
   |
69 |     let versions = modrinth::fetch_modrinth_versions(&http_client, &project.slug, None).await?;
   |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
   |
   = help: the trait `std::marker::Sized` is not implemented for `[sources::modrinth::ModrinthVersion]`
   = note: all local variables must have a statically known size
   = help: unsized locals are gated as an unstable feature

Check failure on line 69 in src/commands/add/modrinth.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the size for values of type `[sources::modrinth::ModrinthVersion]` cannot be known at compilation time

error[E0277]: the size for values of type `[sources::modrinth::ModrinthVersion]` cannot be known at compilation time
  --> src/commands/add/modrinth.rs:69:9
   |
69 |     let versions = modrinth::fetch_modrinth_versions(&http_client, &project.slug, None).await?;
   |         ^^^^^^^^ doesn't have a size known at compile-time
   |
   = help: the trait `std::marker::Sized` is not implemented for `[sources::modrinth::ModrinthVersion]`
   = note: all local variables must have a statically known size
   = help: unsized locals are gated as an unstable feature

Check failure on line 45 in src/commands/import/customs.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function takes 3 arguments but 4 arguments were supplied

error[E0061]: this function takes 3 arguments but 4 arguments were supplied
  --> src/commands/import/customs.rs:45:21
   |
45 |                     Downloadable::from_url_interactive(&http_client, &server, url, false).await
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ------------  ------- unexpected argument of type `&model::servertoml::Server`
   |                                                        |
   |                                                        expected `&App`, found `&Client`
   |
   = note: expected reference `&App`
              found reference `&reqwest::Client`
note: associated function defined here
  --> src/model/downloadable/import_url.rs:16:18
   |
16 |     pub async fn from_url_interactive(
   |                  ^^^^^^^^^^^^^^^^^^^^
17 |         app: &App,
   |         ---------
18 |         urlstr: &str,
   |         ------------
19 |         datapack_mode: bool,
   |         -------------------
help: remove the extra argument
   |
45 -                     Downloadable::from_url_interactive(&http_client, &server, url, false).await
45 +                     Downloadable::from_url_interactive(/* &App */, url, false).await
   |

Check failure on line 22 in src/commands/import/customs.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function takes 3 arguments but 4 arguments were supplied

error[E0061]: this function takes 3 arguments but 4 arguments were supplied
  --> src/commands/import/customs.rs:22:21
   |
22 |                     Downloadable::from_url_interactive(&http_client, &server, url, false).await
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ------------  ------- unexpected argument of type `&model::servertoml::Server`
   |                                                        |
   |                                                        expected `&App`, found `&Client`
   |
   = note: expected reference `&App`
              found reference `&reqwest::Client`
note: associated function defined here
  --> src/model/downloadable/import_url.rs:16:18
   |
16 |     pub async fn from_url_interactive(
   |                  ^^^^^^^^^^^^^^^^^^^^
17 |         app: &App,
   |         ---------
18 |         urlstr: &str,
   |         ------------
19 |         datapack_mode: bool,
   |         -------------------
help: remove the extra argument
   |
22 -                     Downloadable::from_url_interactive(&http_client, &server, url, false).await
22 +                     Downloadable::from_url_interactive(/* &App */, url, false).await
   |

Check failure on line 253 in src/util/packwiz.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function takes 2 arguments but 3 arguments were supplied

error[E0061]: this function takes 2 arguments but 3 arguments were supplied
   --> src/util/packwiz.rs:253:28
    |
253 |             let Some(dl) = Downloadable::from_pw_mod(&m, http_client, server).await? else {
    |                            ^^^^^^^^^^^^^^^^^^^^^^^^^ --  -----------  ------ unexpected argument of type `&mut model::servertoml::Server`
    |                                                      |   |
    |                                                      |   unexpected argument of type `&reqwest::Client`
    |                                                      an argument of type `&App` is missing
    |
note: associated function defined here
   --> src/model/downloadable/packwiz.rs:17:18
    |
17  |     pub async fn from_pw_mod(
    |                  ^^^^^^^^^^^
18  |         app: &App,
    |         ---------
19  |         m: &Mod,
    |         -------
help: did you mean
    |
253 |             let Some(dl) = Downloadable::from_pw_mod(/* &App */, &m).await? else {
    |                                                     ~~~~~~~~~~~~~~~~

Check failure on line 125 in src/util/packwiz.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function takes 2 arguments but 3 arguments were supplied

error[E0061]: this function takes 2 arguments but 3 arguments were supplied
   --> src/util/packwiz.rs:125:28
    |
125 |             let Some(dl) = Downloadable::from_pw_mod(&m, http_client, server).await? else {
    |                            ^^^^^^^^^^^^^^^^^^^^^^^^^ --  -----------  ------ unexpected argument of type `&mut model::servertoml::Server`
    |                                                      |   |
    |                                                      |   unexpected argument of type `&reqwest::Client`
    |                                                      an argument of type `&App` is missing
    |
note: associated function defined here
   --> src/model/downloadable/packwiz.rs:17:18
    |
17  |     pub async fn from_pw_mod(
    |                  ^^^^^^^^^^^
18  |         app: &App,
    |         ---------
19  |         m: &Mod,
    |         -------
help: did you mean
    |
125 |             let Some(dl) = Downloadable::from_pw_mod(/* &App */, &m).await? else {
    |                                                     ~~~~~~~~~~~~~~~~

Check failure on line 157 in src/commands/markdown.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

mismatched types

error[E0308]: mismatched types
   --> src/commands/markdown.rs:157:50
    |
157 |         table.add_from_map(&dp.fetch_info_to_map(http_client).await?);
    |                                ----------------- ^^^^^^^^^^^ expected `&App`, found `&Client`
    |                                |
    |                                arguments to this method are incorrect
    |
    = note: expected reference `&App`
               found reference `&reqwest::Client`
note: method defined here
   --> src/model/downloadable/markdown.rs:47:18
    |
47  |     pub async fn fetch_info_to_map(
    |                  ^^^^^^^^^^^^^^^^^
48  |         &self,
49  |         app: &App,
    |         ---------

Check failure on line 144 in src/commands/markdown.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

mismatched types

error[E0308]: mismatched types
   --> src/commands/markdown.rs:144:53
    |
144 |         table.add_from_map(&addon.fetch_info_to_map(http_client).await?);
    |                                   ----------------- ^^^^^^^^^^^ expected `&App`, found `&Client`
    |                                   |
    |                                   arguments to this method are incorrect
    |
    = note: expected reference `&App`
               found reference `&reqwest::Client`
note: method defined here
   --> src/model/downloadable/markdown.rs:47:18
    |
47  |     pub async fn fetch_info_to_map(
    |                  ^^^^^^^^^^^^^^^^^
48  |         &self,
49  |         app: &App,
    |         ---------

Check failure on line 140 in src/commands/markdown.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

mismatched types

error[E0308]: mismatched types
   --> src/commands/markdown.rs:140:54
    |
140 |         table.add_from_map(&plugin.fetch_info_to_map(http_client).await?);
    |                                    ----------------- ^^^^^^^^^^^ expected `&App`, found `&Client`
    |                                    |
    |                                    arguments to this method are incorrect
    |
    = note: expected reference `&App`
               found reference `&reqwest::Client`
note: method defined here
   --> src/model/downloadable/markdown.rs:47:18
    |
47  |     pub async fn fetch_info_to_map(
    |                  ^^^^^^^^^^^^^^^^^
48  |         &self,
49  |         app: &App,
    |         ---------

Check failure on line 54 in src/util/mrpack.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function takes 3 arguments but 4 arguments were supplied

error[E0061]: this function takes 3 arguments but 4 arguments were supplied
  --> src/util/mrpack.rs:54:22
   |
54 |             let dl = Downloadable::from_url_interactive(http_client, server, url, false).await?;
   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -----------  ------ unexpected argument of type `&mut model::servertoml::Server`
   |                                                         |
   |                                                         expected `&App`, found `&Client`
   |
   = note: expected reference `&App`
              found reference `&reqwest::Client`
note: associated function defined here
  --> src/model/downloadable/import_url.rs:16:18
   |
16 |     pub async fn from_url_interactive(
   |                  ^^^^^^^^^^^^^^^^^^^^
17 |         app: &App,
   |         ---------
18 |         urlstr: &str,
   |         ------------
19 |         datapack_mode: bool,
   |         -------------------
help: remove the extra argument
   |
54 -             let dl = Downloadable::from_url_interactive(http_client, server, url, false).await?;
54 +             let dl = Downloadable::from_url_interactive(/* &App */, url, false).await?;
   |

Check failure on line 32 in src/util/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

no method named `download` found for reference `&impl Source` in the current scope

error[E0599]: no method named `download` found for reference `&impl Source` in the current scope
  --> src/util/mod.rs:32:10
   |
31 |       let response = downloadable
   |  ____________________-
32 | |         .download(server, client)
   | |         -^^^^^^^^ method not found in `&impl Source`
   | |_________|
   | 

Check failure on line 25 in src/commands/import/datapack.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function takes 3 arguments but 4 arguments were supplied

error[E0061]: this function takes 3 arguments but 4 arguments were supplied
  --> src/commands/import/datapack.rs:25:14
   |
25 |     let dl = Downloadable::from_url_interactive(&http_client, &server, &urlstr, true).await?;
   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ------------  ------- unexpected argument of type `&model::servertoml::Server`
   |                                                 |
   |                                                 expected `&App`, found `&Client`
   |
   = note: expected reference `&App`
              found reference `&reqwest::Client`
note: associated function defined here
  --> src/model/downloadable/import_url.rs:16:18
   |
16 |     pub async fn from_url_interactive(
   |                  ^^^^^^^^^^^^^^^^^^^^
17 |         app: &App,
   |         ---------
18 |         urlstr: &str,
   |         ------------
19 |         datapack_mode: bool,
   |         -------------------
help: remove the extra argument
   |
25 -     let dl = Downloadable::from_url_interactive(&http_client, &server, &urlstr, true).await?;
25 +     let dl = Downloadable::from_url_interactive(/* &App */, &urlstr, true).await?;
   |

Check failure on line 23 in src/commands/import/url.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this function takes 3 arguments but 4 arguments were supplied

error[E0061]: this function takes 3 arguments but 4 arguments were supplied
  --> src/commands/import/url.rs:23:17
   |
23 |     let addon = Downloadable::from_url_interactive(&http_client, &server, &urlstr, false).await?;
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ------------  ------- unexpected argument of type `&model::servertoml::Server`
   |                                                    |
   |                                                    expected `&App`, found `&Client`
   |
   = note: expected reference `&App`
              found reference `&reqwest::Client`
note: associated function defined here
  --> src/model/downloadable/import_url.rs:16:18
   |
16 |     pub async fn from_url_interactive(
   |                  ^^^^^^^^^^^^^^^^^^^^
17 |         app: &App,
   |         ---------
18 |         urlstr: &str,
   |         ------------
19 |         datapack_mode: bool,
   |         -------------------
help: remove the extra argument
   |
23 -     let addon = Downloadable::from_url_interactive(&http_client, &server, &urlstr, false).await?;
23 +     let addon = Downloadable::from_url_interactive(/* &App */, &urlstr, false).await?;
   |

Check failure on line 508 in src/util/packwiz.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this method takes 4 arguments but 5 arguments were supplied

error[E0061]: this method takes 4 arguments but 5 arguments were supplied
   --> src/util/packwiz.rs:508:14
    |
508 |             .to_pw_mod(
    |              ^^^^^^^^^
509 |                 http_client,
    |                 ----------- expected `&App`, found `&Client`
510 |                 server,
    |                 ------ unexpected argument of type `&model::servertoml::Server`
    |
    = note: expected reference `&App`
               found reference `&reqwest::Client`
note: method defined here
   --> src/model/downloadable/packwiz.rs:51:18
    |
51  |     pub async fn to_pw_mod(
    |                  ^^^^^^^^^
52  |         &self,
53  |         app: &App,
    |         ---------
54  |         opts: &PackwizExportOptions,
    |         ---------------------------
55  |         is_opt: Option<bool>,
    |         --------------------
56  |         desc_override: &str,
    |         -------------------
help: remove the extra argument
    |
509 -                 http_client,
509 +                 /* &App */,
    |

Check failure on line 500 in src/util/packwiz.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this method takes 4 arguments but 5 arguments were supplied

error[E0061]: this method takes 4 arguments but 5 arguments were supplied
   --> src/util/packwiz.rs:500:29
    |
500 |         if let Some(t) = dl.to_pw_mod(http_client, server, opts, None, "").await? {
    |                             ^^^^^^^^^ -----------  ------ unexpected argument of type `&model::servertoml::Server`
    |                                       |
    |                                       expected `&App`, found `&Client`
    |
    = note: expected reference `&App`
               found reference `&reqwest::Client`
note: method defined here
   --> src/model/downloadable/packwiz.rs:51:18
    |
51  |     pub async fn to_pw_mod(
    |                  ^^^^^^^^^
52  |         &self,
53  |         app: &App,
    |         ---------
54  |         opts: &PackwizExportOptions,
    |         ---------------------------
55  |         is_opt: Option<bool>,
    |         --------------------
56  |         desc_override: &str,
    |         -------------------
help: remove the extra argument
    |
500 -         if let Some(t) = dl.to_pw_mod(http_client, server, opts, None, "").await? {
500 +         if let Some(t) = dl.to_pw_mod(/* &App */, opts, None, "").await? {
    |

Check failure on line 538 in src/util/mrpack.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

no method named `get_url` found for reference `&model::downloadable::Downloadable` in the current scope

error[E0599]: no method named `get_url` found for reference `&model::downloadable::Downloadable` in the current scope
   --> src/util/mrpack.rs:538:37
    |
538 |                 if let Ok(url) = dl.get_url(http_client, server).await {
    |                                     ^^^^^^^ method not found in `&Downloadable`

Check failure on line 537 in src/util/mrpack.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

no method named `get_filename` found for reference `&model::downloadable::Downloadable` in the current scope

error[E0599]: no method named `get_filename` found for reference `&model::downloadable::Downloadable` in the current scope
   --> src/util/mrpack.rs:537:35
    |
537 |                 let filename = dl.get_filename(server, http_client).await?;
    |                                   ^^^^^^^^^^^^ help: there is a method with a similar name: `get_type_name`