Skip to content
GitHub Actions / clippy failed Dec 5, 2023 in 0s

clippy

14 errors, 1 warning

Details

Results

Message level Amount
Internal compiler error 0
Error 14
Warning 1
Note 0
Help 0

Versions

  • rustc 1.74.0 (79e9716c9 2023-11-13)
  • cargo 1.74.0 (ecb9851af 2023-10-18)
  • clippy 0.1.74 (79e9716 2023-11-13)

Annotations

Check failure on line 146 in src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

error: the borrowed expression implements the required traits
   --> src/lib.rs:146:19
    |
146 |             .post(&Endpoint::OauthToken.to_string())
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `Endpoint::OauthToken.to_string()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
    = note: `#[deny(clippy::needless_borrows_for_generic_args)]` implied by `#[deny(warnings)]`

Check failure on line 146 in src/lib.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

the borrowed expression implements the required traits

error: the borrowed expression implements the required traits
   --> src/lib.rs:146:19
    |
146 |             .post(&Endpoint::OauthToken.to_string())
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `Endpoint::OauthToken.to_string()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
    = note: `#[deny(clippy::needless_borrows_for_generic_args)]` implied by `#[deny(warnings)]`

Check failure on line 78 in src/error.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded late initialization

error: unneeded late initialization
  --> src/error.rs:78:9
   |
78 |         let s;
   |         ^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init
help: declare `s` here
   |
79 |         let s = match *self {
   |         +++++++
help: remove the assignments from the `match` arms
   |
81 ~                 format!("A tournament with id ({}) does not exist", id.0)
82 |             }
83 |             IterError::NoTournamentId(_) => {
84 ~                 "A tournament does not have an id set.".to_owned()
85 |             }
86 |             IterError::NoSuchMatch(ref t_id, ref m_id) => {
87 ~                 format!(
88 |                     "A match does not exist (tournament id = {}, match id = {})",
89 |                     t_id.0, m_id.0
90 ~                 )
91 |             }
92 |             IterError::NoPermissionId => {
93 ~                 "A permission does not have an id set.".to_owned()
94 |             }
95 |             IterError::NoSuchDiscipline(ref id) => {
96 ~                 format!("A permission with id ({}) does not exist.", id.0)
   |

Check failure on line 312 in src/endpoints.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

`to_string` applied to a type that implements `Display` in `format!` args

error: `to_string` applied to a type that implements `Display` in `format!` args
   --> src/endpoints.rs:312:39
    |
312 |     out.push(format!("sort={}", f.sort.to_string()));
    |                                       ^^^^^^^^^^^^ help: remove this
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args

Check failure on line 310 in src/endpoints.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

`to_string` applied to a type that implements `Display` in `format!` args

error: `to_string` applied to a type that implements `Display` in `format!` args
   --> src/endpoints.rs:310:42
    |
310 |         out.push(format!("category={}", c.to_string()));
    |                                          ^^^^^^^^^^^^ help: remove this
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args

Check failure on line 302 in src/endpoints.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

`to_string` applied to a type that implements `Display` in `format!` args

error: `to_string` applied to a type that implements `Display` in `format!` args
   --> src/endpoints.rs:302:15
    |
302 |         f.sort.to_string(),
    |               ^^^^^^^^^^^^ help: remove this
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args

Check failure on line 270 in src/endpoints.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

`to_string` applied to a type that implements `Display` in `format!` args

error: `to_string` applied to a type that implements `Display` in `format!` args
   --> src/endpoints.rs:270:38
    |
270 |         out.push(format!("sort={}", s.to_string()));
    |                                      ^^^^^^^^^^^^ help: remove this
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args
    = note: `#[deny(clippy::to_string_in_format_args)]` implied by `#[deny(warnings)]`

Check failure on line 83 in src/endpoints.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded late initialization

error: unneeded late initialization
  --> src/endpoints.rs:83:9
   |
83 |         let address;
   |         ^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init
note: the lint level is defined here
  --> src/lib.rs:35:9
   |
35 | #![deny(warnings)]
   |         ^^^^^^^^
   = note: `#[deny(clippy::needless_late_init)]` implied by `#[deny(warnings)]`
help: declare `address` here
   |
84 |         let address = match *self {
   |         +++++++++++++
help: remove the assignments from the `match` arms
   |
85 ~             Endpoint::OauthToken => "/oauth/v2/token".to_owned(),
86 ~             Endpoint::AllDisciplines => "/v1/disciplines".to_owned(),
87 ~             Endpoint::DisciplineById(ref id) => format!("/v1/disciplines/{}", id.0),
88 |             Endpoint::AllTournaments { with_streams } => {
89 ~                 format!(
90 |                     "/v1/tournaments?with_streams={}",
 ...
93 |             }
94 ~             Endpoint::MyTournaments => "/v1/me/tournaments".to_owned(),
95 |             Endpoint::TournamentByIdGet {
 ...
98 |             } => {
99 ~                 format!(
100|                     "/v1/tournaments/{}?with_streams={}",
 ...
105|             Endpoint::TournamentByIdUpdate(ref tournament_id) => {
106~                 format!("/v1/tournaments/{}", tournament_id.0)
107|             }
108~             Endpoint::TournamentCreate => "/v1/tournaments".to_owned(),
109|             Endpoint::MatchesByTournament {
 ...
112|             } => {
113~                 format!(
114|                     "/v1/tournaments/{}/matches?with_games={}",
 ...
123|             } => {
124~                 format!(
125|                     "/v1/tournaments/{}/matches/{}?with_games={}",
 ...
133|                 ref match_id,
134~             } => format!("/v1/tournaments/{}/matches/{}", tournament_id.0, match_id.0),
135|             Endpoint::MatchesByDiscipline {
 ...
138|             } => {
139~                 format!(
140|                     "/v1/disciplines/{}/matches?{}",
 ...
145|             Endpoint::MatchResult(ref tournament_id, ref match_id) => {
146~                 format!(
147|                     "/v1/tournaments/{}/matches/{}/result",
 ...
155|             } => {
156~                 format!(
157|                     "/v1/tournaments/{}/matches/{}/games?with_stats={}",
 ...
168|             } => {
169~                 format!(
170|                     "/v1/tournaments/{}/matches/{}/games/{}?with_stats={}",
 ...
181|             } => {
182~                 format!(
183|                     "/v1/tournaments/{}/matches/{}/games/{}",
 ...
191|             } => {
192~                 format!(
193|                     "/v1/tournaments/{}/matches/{}/games/{}/result",
 ...
202|             } => {
203~                 format!(
204|                     "/v1/tournaments/{}/matches/{}/games/{}/result?update_match={}",
 ...
214|             } => {
215~                 format!(
216|                     "/v1/tournaments/{}/participants?{}",
 ...
221|             Endpoint::ParticipantCreate(ref tournament_id) => {
222~                 format!("/v1/tournaments/{}/participants", tournament_id.0)
223|             }
224|             Endpoint::ParticipantsUpdate(ref tournament_id) => {
225~                 format!("/v1/tournaments/{}/participants", tournament_id.0)
226|             }
227|             Endpoint::ParticipantById(ref tournament_id, ref participant_id) => {
228~                 format!(
229|                     "/v1/tournaments/{}/participants/{}",
 ...
233|             Endpoint::Permissions(ref tournament_id) => {
234~                 format!("/v1/tournaments/{}/permissions", tournament_id.0)
235|             }
236|             Endpoint::PermissionById(ref tournament_id, ref permission_id) => {
237~                 format!(
238|                     "/v1/tournaments/{}/permissions/{}",
 ...
242|             Endpoint::Stages(ref tournament_id) => {
243~                 format!("/v1/tournaments/{}/stages", tournament_id.0)
244|             }
 ...
248|             } => {
249~                 format!(
   |

Check failure on line 78 in src/error.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded late initialization

error: unneeded late initialization
  --> src/error.rs:78:9
   |
78 |         let s;
   |         ^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init
help: declare `s` here
   |
79 |         let s = match *self {
   |         +++++++
help: remove the assignments from the `match` arms
   |
81 ~                 format!("A tournament with id ({}) does not exist", id.0)
82 |             }
83 |             IterError::NoTournamentId(_) => {
84 ~                 "A tournament does not have an id set.".to_owned()
85 |             }
86 |             IterError::NoSuchMatch(ref t_id, ref m_id) => {
87 ~                 format!(
88 |                     "A match does not exist (tournament id = {}, match id = {})",
89 |                     t_id.0, m_id.0
90 ~                 )
91 |             }
92 |             IterError::NoPermissionId => {
93 ~                 "A permission does not have an id set.".to_owned()
94 |             }
95 |             IterError::NoSuchDiscipline(ref id) => {
96 ~                 format!("A permission with id ({}) does not exist.", id.0)
   |

Check failure on line 312 in src/endpoints.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

`to_string` applied to a type that implements `Display` in `format!` args

error: `to_string` applied to a type that implements `Display` in `format!` args
   --> src/endpoints.rs:312:39
    |
312 |     out.push(format!("sort={}", f.sort.to_string()));
    |                                       ^^^^^^^^^^^^ help: remove this
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args

Check failure on line 310 in src/endpoints.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

`to_string` applied to a type that implements `Display` in `format!` args

error: `to_string` applied to a type that implements `Display` in `format!` args
   --> src/endpoints.rs:310:42
    |
310 |         out.push(format!("category={}", c.to_string()));
    |                                          ^^^^^^^^^^^^ help: remove this
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args

Check failure on line 302 in src/endpoints.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

`to_string` applied to a type that implements `Display` in `format!` args

error: `to_string` applied to a type that implements `Display` in `format!` args
   --> src/endpoints.rs:302:15
    |
302 |         f.sort.to_string(),
    |               ^^^^^^^^^^^^ help: remove this
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args

Check failure on line 270 in src/endpoints.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

`to_string` applied to a type that implements `Display` in `format!` args

error: `to_string` applied to a type that implements `Display` in `format!` args
   --> src/endpoints.rs:270:38
    |
270 |         out.push(format!("sort={}", s.to_string()));
    |                                      ^^^^^^^^^^^^ help: remove this
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args
    = note: `#[deny(clippy::to_string_in_format_args)]` implied by `#[deny(warnings)]`

Check failure on line 83 in src/endpoints.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded late initialization

error: unneeded late initialization
  --> src/endpoints.rs:83:9
   |
83 |         let address;
   |         ^^^^^^^^^^^^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init
note: the lint level is defined here
  --> src/lib.rs:35:9
   |
35 | #![deny(warnings)]
   |         ^^^^^^^^
   = note: `#[deny(clippy::needless_late_init)]` implied by `#[deny(warnings)]`
help: declare `address` here
   |
84 |         let address = match *self {
   |         +++++++++++++
help: remove the assignments from the `match` arms
   |
85 ~             Endpoint::OauthToken => "/oauth/v2/token".to_owned(),
86 ~             Endpoint::AllDisciplines => "/v1/disciplines".to_owned(),
87 ~             Endpoint::DisciplineById(ref id) => format!("/v1/disciplines/{}", id.0),
88 |             Endpoint::AllTournaments { with_streams } => {
89 ~                 format!(
90 |                     "/v1/tournaments?with_streams={}",
 ...
93 |             }
94 ~             Endpoint::MyTournaments => "/v1/me/tournaments".to_owned(),
95 |             Endpoint::TournamentByIdGet {
 ...
98 |             } => {
99 ~                 format!(
100|                     "/v1/tournaments/{}?with_streams={}",
 ...
105|             Endpoint::TournamentByIdUpdate(ref tournament_id) => {
106~                 format!("/v1/tournaments/{}", tournament_id.0)
107|             }
108~             Endpoint::TournamentCreate => "/v1/tournaments".to_owned(),
109|             Endpoint::MatchesByTournament {
 ...
112|             } => {
113~                 format!(
114|                     "/v1/tournaments/{}/matches?with_games={}",
 ...
123|             } => {
124~                 format!(
125|                     "/v1/tournaments/{}/matches/{}?with_games={}",
 ...
133|                 ref match_id,
134~             } => format!("/v1/tournaments/{}/matches/{}", tournament_id.0, match_id.0),
135|             Endpoint::MatchesByDiscipline {
 ...
138|             } => {
139~                 format!(
140|                     "/v1/disciplines/{}/matches?{}",
 ...
145|             Endpoint::MatchResult(ref tournament_id, ref match_id) => {
146~                 format!(
147|                     "/v1/tournaments/{}/matches/{}/result",
 ...
155|             } => {
156~                 format!(
157|                     "/v1/tournaments/{}/matches/{}/games?with_stats={}",
 ...
168|             } => {
169~                 format!(
170|                     "/v1/tournaments/{}/matches/{}/games/{}?with_stats={}",
 ...
181|             } => {
182~                 format!(
183|                     "/v1/tournaments/{}/matches/{}/games/{}",
 ...
191|             } => {
192~                 format!(
193|                     "/v1/tournaments/{}/matches/{}/games/{}/result",
 ...
202|             } => {
203~                 format!(
204|                     "/v1/tournaments/{}/matches/{}/games/{}/result?update_match={}",
 ...
214|             } => {
215~                 format!(
216|                     "/v1/tournaments/{}/participants?{}",
 ...
221|             Endpoint::ParticipantCreate(ref tournament_id) => {
222~                 format!("/v1/tournaments/{}/participants", tournament_id.0)
223|             }
224|             Endpoint::ParticipantsUpdate(ref tournament_id) => {
225~                 format!("/v1/tournaments/{}/participants", tournament_id.0)
226|             }
227|             Endpoint::ParticipantById(ref tournament_id, ref participant_id) => {
228~                 format!(
229|                     "/v1/tournaments/{}/participants/{}",
 ...
233|             Endpoint::Permissions(ref tournament_id) => {
234~                 format!("/v1/tournaments/{}/permissions", tournament_id.0)
235|             }
236|             Endpoint::PermissionById(ref tournament_id, ref permission_id) => {
237~                 format!(
238|                     "/v1/tournaments/{}/permissions/{}",
 ...
242|             Endpoint::Stages(ref tournament_id) => {
243~                 format!("/v1/tournaments/{}/stages", tournament_id.0)
244|             }
 ...
248|             } => {
249~                 format!(
   |

Check warning on line 6 in external_markdown_tests/build.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
 --> external_markdown_tests/build.rs:6:30
  |
6 |     let dir = match read_dir(&dir_path) {
  |                              ^^^^^^^^^ help: change this to: `dir_path`
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
  = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default